Merge "pgsql: fix self._conn.close() being called without connection"

This commit is contained in:
Jenkins 2017-06-23 00:10:05 +00:00 committed by Gerrit Code Review
commit 743603a07c
1 changed files with 2 additions and 1 deletions

View File

@ -146,7 +146,8 @@ class PostgresLock(locking.Lock):
try:
return _lock()
except Exception:
self._conn.close()
if self._conn:
self._conn.close()
raise
def release(self):