]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- suppressing *all* errors in InstanceState.__cleanup() now.
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 6 Jan 2008 20:41:48 +0000 (20:41 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 6 Jan 2008 20:41:48 +0000 (20:41 +0000)
CHANGES
lib/sqlalchemy/orm/attributes.py

diff --git a/CHANGES b/CHANGES
index 20a39f51e112323fd3c5a155c41f4ec337e57367..c9922fc34a1c262634cdbc53f967c19c22394c14 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,8 @@ CHANGES
       for SQL expression purposes is still fine) [ticket:912]
 
 - orm
+    - suppressing *all* errors in InstanceState.__cleanup() now.  
+    
     - Fixed cascades on a += assignment to a list-based relation.
     
     - synonyms can now be created against props that don't exist yet,
index 1639055bd4a058a3ccc32de762befa91680ee787..a95ae0500230cbe694d8a6b21f7cb50571c0ab99 100644 (file)
@@ -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()