]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
instance_dict may be modified before the GC triggers _cleanup on Jython, so eat
authorPhilip Jenvey <pjenvey@underboss.org>
Fri, 21 Aug 2009 02:19:07 +0000 (02:19 +0000)
committerPhilip Jenvey <pjenvey@underboss.org>
Fri, 21 Aug 2009 02:19:07 +0000 (02:19 +0000)
state mismatch AssertionErrors

lib/sqlalchemy/orm/state.py

index f09c5976399ec05c029c0d9bce074b9f16a0096c..25e557edae0215431892ca5d528b6558d9bbef24 100644 (file)
@@ -47,7 +47,10 @@ class InstanceState(object):
     def _cleanup(self, ref):
         instance_dict = self._instance_dict()
         if instance_dict:
-            instance_dict.remove(self)
+            try:
+                instance_dict.remove(self)
+            except AssertionError:
+                pass
         self.dispose()
     
     def obj(self):
@@ -418,7 +421,10 @@ class MutableAttrInstanceState(InstanceState):
         else:
             instance_dict = self._instance_dict()
             if instance_dict:
-                instance_dict.remove(self)
+                try:
+                    instance_dict.remove(self)
+                except AssertionError:
+                    pass
             self.dispose()
             
     def __resurrect(self):