Ignored repeated calls to connection.close().

Forwardport of 9bbb43dd1a from stable/1.7.x
This commit is contained in:
Aymeric Augustin 2014-04-24 08:42:30 +02:00 committed by Tim Graham
parent d238c58912
commit b0f4eecfa7
1 changed files with 2 additions and 0 deletions

View File

@ -183,6 +183,8 @@ class BaseDatabaseWrapper(object):
# Don't call validate_no_atomic_block() to avoid making it difficult
# to get rid of a connection in an invalid state. The next connect()
# will reset the transaction state anyway.
if self.closed_in_transaction or self.connection is None:
return
try:
self._close()
finally: