]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
catch AttributeError in case thread local storage was not configured
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Aug 2008 16:33:01 +0000 (16:33 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 19 Aug 2008 16:33:01 +0000 (16:33 +0000)
lib/sqlalchemy/util.py

index c2d4bf6abf842f57a600d5d8035784d169dfe62a..443ab8878fc03fc7846a52f94176e54237032780 100644 (file)
@@ -1173,7 +1173,10 @@ class _TLocalRegistry(ScopedRegistry):
         self.registry.value = obj
 
     def clear(self):
-        del self.registry.value
+        try:
+            del self.registry.value
+        except AttributeError:
+            pass
 
 class WeakCompositeKey(object):
     """an weak-referencable, hashable collection which is strongly referenced