[PATCH 1 of 3] dispatch: handle IndexErrors
Dan Villiom Podlaski Christiansen
danchr at gmail.com
Sun May 1 04:20:07 CDT 2011
# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1304240517 -7200
# Node ID ccaee15b3eb1b0fbfa877353a0ff46bdb59bb7aa
# Parent 434425e33941a9ef3f0086a3e6188e24984eecb5
dispatch: handle IndexErrors
diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -133,7 +133,8 @@ def _runcatch(ui, args):
elif hasattr(inst, "reason"):
try: # usually it is in the form (errno, strerror)
reason = inst.reason.args[1]
- except AttributeError: # it might be anything, for example a string
+ except (AttributeError, IndexError):
+ # it might be anything, for example a string
reason = inst.reason
ui.warn(_("abort: error: %s\n") % reason)
elif hasattr(inst, "args") and inst.args[0] == errno.EPIPE:
More information about the Mercurial-devel
mailing list