diff mercurial/commands.py @ 2335:f0680b2d1d64

add ui.print_exc(), make all traceback printing central.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Mon, 22 May 2006 08:47:53 -0700
parents 953dbfb2824c
children eb08fb4d41e1
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3299,10 +3299,8 @@ def dispatch(args):
             external.append(mod)
         except Exception, inst:
             u.warn(_("*** failed to import extension %s: %s\n") % (x[0], inst))
-            if u.traceback:
-                traceback.print_exc()
+            if u.print_exc():
                 return 1
-            continue
 
     for x in external:
         uisetup = getattr(x, 'uisetup', None)
@@ -3398,8 +3396,7 @@ def dispatch(args):
             # enter the debugger when we hit an exception
             if options['debugger']:
                 pdb.post_mortem(sys.exc_info()[2])
-            if u.traceback:
-                traceback.print_exc()
+            u.print_exc()
             raise
     except ParseError, inst:
         if inst.args[0]: