]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed a potential KeyError which under some
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Apr 2011 15:33:06 +0000 (11:33 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 25 Apr 2011 15:33:06 +0000 (11:33 -0400)
    circumstances could occur with the identity
    map, part of [ticket:2148]

CHANGES
lib/sqlalchemy/orm/identity.py

diff --git a/CHANGES b/CHANGES
index 48fd755a446e957c62c88bcbd382a527c7abfdb7..cc96f18b5045d56da1655176493fcf6f77596c3d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -21,6 +21,10 @@ CHANGES
     a deprecation warning in 0.6.8.  
     [ticket:2144]
 
+  - Fixed a potential KeyError which under some
+    circumstances could occur with the identity 
+    map, part of [ticket:2148]
+
   - added Query.with_session() method, switches 
     Query to use a different session.
 
index a53d9f52db23a8bce17fb6044b44dfc7a8e66154..8f000e419c13215649b2156f41c6d7db5227b065 100644 (file)
@@ -138,9 +138,9 @@ class WeakInstanceDict(IdentityMap):
         self._manage_incoming_state(state)
 
     def get(self, key, default=None):
-        if not dict.__contains__(self, key):
+        state = dict.get(self, key, default)
+        if state is default:
             return default
-        state = dict.__getitem__(self, key)
         o = state.obj()
         if o is None:
             o = state._is_really_none()