Mercurial > hg-stable
changeset 10292:ea7a14ca118a
bugzilla: lowercase mysqldb var
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 28 Jan 2010 22:45:04 -0600 |
parents | 61c93743fae0 |
children | cade47dcac2d |
files | hgext/bugzilla.py |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/bugzilla.py Thu Jan 28 22:44:54 2010 -0600 +++ b/hgext/bugzilla.py Thu Jan 28 22:45:04 2010 -0600 @@ -145,7 +145,7 @@ from mercurial import cmdutil, templater, util import re, time -MySQLdb = None +mysqldb = None def buglist(ids): return '(' + ','.join(map(str, ids)) + ')' @@ -165,7 +165,7 @@ 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() @@ -177,7 +177,7 @@ 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 @@ -419,9 +419,9 @@ 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) @@ -436,6 +436,6 @@ 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])