# HG changeset patch # User Benoit Boissinot # Date 1130190792 25200 # Node ID 918cb47d725e1c57014bc39a0e6d67e7c14c8f74 # Parent 76239f0cb0dcab94719722bf45bdceb6adf08002 [issue21] cannot debug extension The following patch should work. diff -r 76239f0cb0dc -r 918cb47d725e mercurial/commands.py --- a/mercurial/commands.py Mon Oct 24 14:52:49 2005 -0700 +++ b/mercurial/commands.py Mon Oct 24 14:53:12 2005 -0700 @@ -2068,11 +2068,16 @@ u = ui.ui() external = [] for x in u.extensions(): + def on_exception(Exception, inst): + u.warn(_("*** failed to import extension %s\n") % x[1]) + u.warn("%s\n" % inst) + if "--traceback" in sys.argv[1:]: + traceback.print_exc() if x[1]: try: mod = imp.load_source(x[0], x[1]) - except: - u.warn(_("*** failed to import extension %s\n") % x[1]) + except Exception, inst: + on_exception(Exception, inst) continue else: def importh(name): @@ -2083,8 +2088,8 @@ return mod try: mod = importh(x[0]) - except: - u.warn(_("failed to import extension %s\n") % x[0]) + except Exception, inst: + on_exception(Exception, inst) continue external.append(mod)