]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
check for session is none, [ticket:940]
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 17 Jan 2008 16:24:26 +0000 (16:24 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 17 Jan 2008 16:24:26 +0000 (16:24 +0000)
CHANGES
lib/sqlalchemy/orm/session.py

diff --git a/CHANGES b/CHANGES
index af2101e5da2ee1157175015b91b25a1521b3fbc8..246853b3d97d9ca955380caa96cfae3eb7b28440 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -51,6 +51,8 @@ CHANGES
     
     - fixed a rather expensive call in Query that was slowing
       down polymorphic queries
+
+    - miscellaneous tickets:  [ticket:940]
         
 - general
     - warnings are now issued as type exceptions.SAWarning.
index 0d58a52161b59cb12fced954117186859ac44329..e2bc71b92e36731b3eb3d62eed218c17a3ba8146 100644 (file)
@@ -1141,7 +1141,7 @@ def object_session(instance):
     hashkey = getattr(instance, '_sa_session_id', None)
     if hashkey is not None:
         sess = _sessions.get(hashkey)
-        if instance in sess:
+        if sess is not None and instance in sess:
             return sess
     return None