From: Mike Bayer Date: Sat, 27 Jul 2013 22:41:34 +0000 (-0400) Subject: - this collection can be None on cleanup, so check for that X-Git-Tag: rel_0_9_0b1~161 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=effad0a4e33d40940ca669f4f88c7cb9961db4da;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - this collection can be None on cleanup, so check for that --- diff --git a/lib/sqlalchemy/event/registry.py b/lib/sqlalchemy/event/registry.py index af07493f4a..330650e562 100644 --- a/lib/sqlalchemy/event/registry.py +++ b/lib/sqlalchemy/event/registry.py @@ -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():