# HG changeset patch # User Benoit Boissinot # Date 1167264852 -3600 # Node ID e282448d68f16226c7f3510c7c54606e2819c5af # Parent 86098ec4b77a8596bdd8ca1f365e117ab4ce8fdc inst.reason isn't alway in the form (errno, strerror) urllib2.urlopen("foobar://foo") is an example where inst.reason is a string fix issue383 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3277,7 +3277,11 @@ def dispatch(args): if hasattr(inst, "code"): u.warn(_("abort: %s\n") % inst) elif hasattr(inst, "reason"): - u.warn(_("abort: error: %s\n") % inst.reason[1]) + try: # usually it is in the form (errno, strerror) + reason = inst.reason.args[1] + except: # it might be anything, for example a string + reason = inst.reason + u.warn(_("abort: error: %s\n") % reason) elif hasattr(inst, "args") and inst[0] == errno.EPIPE: if u.debugflag: u.warn(_("broken pipe\n"))