]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- this collection can be None on cleanup, so check for that
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 Jul 2013 22:41:34 +0000 (18:41 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 27 Jul 2013 22:41:34 +0000 (18:41 -0400)
lib/sqlalchemy/event/registry.py

index af07493f4ab6a5ff89312303680c005cd73b2557..330650e562245c2ebd13dbfe5855e53878dd8742 100644 (file)
@@ -41,7 +41,7 @@ ref(listenercollection) -> {
 
 def _collection_gced(ref):
     # defaultdict, so can't get a KeyError
-    if ref not in _collection_to_key:
+    if not _collection_to_key or ref not in _collection_to_key:
         return
     listener_to_key = _collection_to_key.pop(ref)
     for key in listener_to_key.values():