Dirkjan Ochtman avatar Dirkjan Ochtman committed 3062af0

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

Comments (0)

Files changed (1)

hgext/bugzilla.py

 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))
         try:
             self.cursor.execute(*args, **kwargs)
-        except mysqldb.MySQLError:
+        except MySQLdb.MySQLError:
             self.ui.note(_('failed query: %s %s\n') % (args, kwargs))
             raise
 
     bugzilla bug id. only add a comment once per bug, so same change
     seen multiple times does not fill bug with duplicate data.'''
     try:
-        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])
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.