From 50ae546613b7f2ed26631fffc8961bf6cb12a53c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 6 Jul 2010 15:18:59 +0200 Subject: Fixed exception when restarting mysql connection --- modules/mysql.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/mysql.py b/modules/mysql.py index 5ae9e93..a690f00 100644 --- a/modules/mysql.py +++ b/modules/mysql.py @@ -12,7 +12,11 @@ class Module(ModuleBase): def _connect(self): if self.db: - self.db.close() + try: + self.db.close() + except: + pass + self.db = MySQLdb.connect(host = self.conf['host'], user = self.conf['user'], passwd = self.conf['passwd'], db = self.conf['db'], use_unicode = True, charset = 'utf8') def cursor(self): -- cgit v1.2.3