diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 21:37:52 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2010-12-21 21:37:52 -0500 |
commit | b79a5e7640fc1c8ca7acce5bfd2509ddf0102080 (patch) | |
tree | 4fce95f955d2f1ca15ded2c3030e78b79e82cb68 /lib/sqlalchemy/orm/identity.py | |
parent | dff4e0591eee3def7c4c38666c8fc581c327aa87 (diff) | |
download | sqlalchemy-b79a5e7640fc1c8ca7acce5bfd2509ddf0102080.tar.gz |
- another heap of inlinings and now I really have to be done with this
Diffstat (limited to 'lib/sqlalchemy/orm/identity.py')
-rw-r--r-- | lib/sqlalchemy/orm/identity.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/sqlalchemy/orm/identity.py b/lib/sqlalchemy/orm/identity.py index f1400a8c6..c55db39dc 100644 --- a/lib/sqlalchemy/orm/identity.py +++ b/lib/sqlalchemy/orm/identity.py @@ -151,7 +151,9 @@ class WeakInstanceDict(IdentityMap): self._remove_mutex.acquire() try: if dict.pop(self, state.key) is not state: - raise AssertionError("State %s is not present in this identity map" % state) + raise AssertionError( + "State %s is not present in this " + "identity map" % state) finally: self._remove_mutex.release() @@ -245,15 +247,20 @@ class StrongInstanceDict(IdentityMap): def add(self, state): if state.key in self: - if attributes.instance_state(dict.__getitem__(self, state.key)) is not state: - raise AssertionError("A conflicting state is already present in the identity map for key %r" % (state.key, )) + if attributes.instance_state(dict.__getitem__(self, + state.key)) is not state: + raise AssertionError('A conflicting state is already ' + 'present in the identity map for key %r' + % (state.key, )) else: dict.__setitem__(self, state.key, state.obj()) self._manage_incoming_state(state) def remove(self, state): - if attributes.instance_state(dict.pop(self, state.key)) is not state: - raise AssertionError("State %s is not present in this identity map" % state) + if attributes.instance_state(dict.pop(self, state.key)) \ + is not state: + raise AssertionError('State %s is not present in this ' + 'identity map' % state) self._manage_removed_state(state) def discard(self, state): |