summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-01-06 20:41:48 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-01-06 20:41:48 +0000
commitacd13f99f18ad02b2e51e8be7303124e40c55473 (patch)
tree780ac06edfe694f58ec1739dd59eb2adc9dd9510 /lib/sqlalchemy
parentd879135085d442b942253688dd5d20edc2b560ec (diff)
downloadsqlalchemy-acd13f99f18ad02b2e51e8be7303124e40c55473.tar.gz
- suppressing *all* errors in InstanceState.__cleanup() now.
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/orm/attributes.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/lib/sqlalchemy/orm/attributes.py b/lib/sqlalchemy/orm/attributes.py
index 1639055bd..a95ae0500 100644
--- a/lib/sqlalchemy/orm/attributes.py
+++ b/lib/sqlalchemy/orm/attributes.py
@@ -687,7 +687,7 @@ class InstanceState(object):
return
instance_dict = instance_dict()
- if instance_dict is None:
+ if instance_dict is None or instance_dict._mutex is None:
return
# the mutexing here is based on the assumption that gc.collect()
@@ -695,17 +695,11 @@ class InstanceState(object):
# which is normally operating upon the instance dict.
instance_dict._mutex.acquire()
try:
- # if instance_dict de-refed us, or it called our
- # _resurrect, return. again setting local copy
- # to avoid the rug being pulled in between
- id2 = self.instance_dict
- if id2 is None or id2() is None or self.obj() is not None:
- return
-
try:
self.__resurrect(instance_dict)
except:
- # catch GC exceptions
+ # catch app cleanup exceptions. no other way around this
+ # without warnings being produced
pass
finally:
instance_dict._mutex.release()