diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-07-06 15:18:59 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-07-06 15:18:59 +0200 |
commit | 50ae546613b7f2ed26631fffc8961bf6cb12a53c (patch) | |
tree | d03db1d6bf5ff8c173d7de21ed13ee8fa1116401 | |
parent | da16ab1b1bbbd54fee146fa182629520d4c371f1 (diff) | |
download | curunir-50ae546613b7f2ed26631fffc8961bf6cb12a53c.tar curunir-50ae546613b7f2ed26631fffc8961bf6cb12a53c.zip |
Fixed exception when restarting mysql connection
-rw-r--r-- | modules/mysql.py | 6 |
1 files changed, 5 insertions, 1 deletions
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): |