Revision: 7588 Author: btongminh Date: 2009-11-03 20:36:09 +0000 (Tue, 03 Nov 2009)
Log Message: ----------- Close the database the clean way, instead of the hack try..except
Modified Paths: -------------- trunk/pywikipedia/mysql_autoconnection.py
Modified: trunk/pywikipedia/mysql_autoconnection.py =================================================================== --- trunk/pywikipedia/mysql_autoconnection.py 2009-11-03 11:59:53 UTC (rev 7587) +++ trunk/pywikipedia/mysql_autoconnection.py 2009-11-03 20:36:09 UTC (rev 7588) @@ -36,6 +36,7 @@ self.max_retries = max_retries self.current_retry = 0 self.callback = callback + self.database = None
self.conn_args = conn_args self.conn_kwargs = conn_kwargs @@ -83,7 +84,8 @@ self.current_retry = 0 self.connected = False try: - self.database.close() + if self.database: + self.database.close() except: pass