Update database.py

Inverted logic means _release_internal will always fail on a rollback. Fixed and simplified.
This commit is contained in:
Tyler Kennedy 2014-07-31 11:07:09 -04:00
parent 9a91f3d113
commit 91c985b3e8

View File

@ -80,7 +80,7 @@ class Database(object):
self.local.must_release = True
def _release_internal(self):
if not hasattr(self.local, 'must_release') and self.local.must_release:
if getattr(self.local, 'must_release', None):
self.lock.release()
self.local.must_release = False