summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradustman <adustman@9fc6cd9a-920d-0410-adcf-ac96716ed7e8>2002-08-01 04:48:48 +0000
committeradustman <adustman@9fc6cd9a-920d-0410-adcf-ac96716ed7e8>2002-08-01 04:48:48 +0000
commitb302b3ba691c2917f245fbb041f15c7ead8db54a (patch)
tree202571c414518ded7dc89547f081112d3d17fa95
parente46dbaf59f5348282ba2f7e09abe470958a02584 (diff)
downloadmysqldb1-b302b3ba691c2917f245fbb041f15c7ead8db54a.tar.gz
Ignore exception from close() in __del__
-rw-r--r--MySQLdb/MySQLdb/connections.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/MySQLdb/MySQLdb/connections.py b/MySQLdb/MySQLdb/connections.py
index ca4b360..19d5489 100644
--- a/MySQLdb/MySQLdb/connections.py
+++ b/MySQLdb/MySQLdb/connections.py
@@ -120,8 +120,11 @@ class Connection(ConnectionBase):
self.messages = []
def __del__(self):
- self.close()
-
+ try:
+ self.close()
+ except:
+ pass
+
def begin(self):
"""Explicitly begin a transaction. Non-standard."""
self.query("BEGIN")