From 1eaa37ca32a4c036872b5de629b6b6868d93f2f2 Mon Sep 17 00:00:00 2001 From: Dan Villiom Podlaski Christiansen Date: Sun, 1 May 2011 11:01:57 +0200 Subject: [PATCH] dispatch: handle IndexErrors --- mercurial/dispatch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py index 3112c4e249..eeb6273224 100644 --- 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: