1. Benoit Boissinot
  2. mercurial/crew/tonfa


Dirkjan Ochtman  committed 3062af0

bugzilla: revert unhelpful check-code changes, module is actually called MySQLdb

  • Participants
  • Parent commits 3076b39
  • Branches stable

Comments (0)

Files changed (1)

File hgext/bugzilla.py

View file
 from mercurial import cmdutil, templater, util
 import re, time
-mysqldb = None
+MySQLdb = None
 def buglist(ids):
     return '(' + ','.join(map(str, ids)) + ')'
             self.ui.readconfig(usermap, sections=['usermap'])
         self.ui.note(_('connecting to %s:%s as %s, password %s\n') %
                      (host, db, user, '*' * len(passwd)))
-        self.conn = mysqldb.connect(host=host, user=user, passwd=passwd,
+        self.conn = MySQLdb.connect(host=host, user=user, passwd=passwd,
                                     db=db, connect_timeout=timeout)
         self.cursor = self.conn.cursor()
         self.longdesc_id = self.get_longdesc_id()
         self.ui.note(_('query: %s %s\n') % (args, kwargs))
             self.cursor.execute(*args, **kwargs)
-        except mysqldb.MySQLError:
+        except MySQLdb.MySQLError:
             self.ui.note(_('failed query: %s %s\n') % (args, kwargs))
     bugzilla bug id. only add a comment once per bug, so same change
     seen multiple times does not fill bug with duplicate data.'''
-        import mysqldb as mysql
-        global mysqldb
-        mysqldb = mysql
+        import MySQLdb as mysql
+        global MySQLdb
+        MySQLdb = mysql
     except ImportError, err:
         raise util.Abort(_('python mysql support not available: %s') % err)
             for id in ids:
                 bz.update(id, ctx)
             bz.notify(ids, util.email(ctx.user()))
-    except mysqldb.MySQLError, err:
+    except MySQLdb.MySQLError, err:
         raise util.Abort(_('database error: %s') % err[1])