From b302b3ba691c2917f245fbb041f15c7ead8db54a Mon Sep 17 00:00:00 2001 From: adustman Date: Thu, 1 Aug 2002 04:48:48 +0000 Subject: [PATCH] Ignore exception from close() in __del__ --- MySQLdb/MySQLdb/connections.py | 7 +++++-- 1 file 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")