[PATCH 6 of 9] bugzilla: removed exception args indexing (not supported by py3k)

Renato Cunha renatoc at gmail.com
Wed Jul 14 21:18:39 CDT 2010


# HG changeset patch
# User Renato Cunha <renatoc at gmail.com>
# Date 1279159436 10800
# Branch stable
# Node ID a943677dcd2fc06048a0d5dafb48e13ed32fc866
# Parent  3a94f478b97a024269ef42d83ecd1bf4b2e5b457
bugzilla: removed exception args indexing (not supported by py3k)

Py3k removed __getitem__ for exception classes. The correct way of getting the
exception arguments is by using the args method.

diff --git a/hgext/bugzilla.py b/hgext/bugzilla.py
--- a/hgext/bugzilla.py
+++ b/hgext/bugzilla.py
@@ -437,5 +437,5 @@
                 bz.update(id, ctx)
             bz.notify(ids, util.email(ctx.user()))
     except MySQLdb.MySQLError, err:
-        raise util.Abort(_('database error: %s') % err[1])
+        raise util.Abort(_('database error: %s') % err.args[1])
 


More information about the Mercurial-devel mailing list