dispatch: handle empty IOError args

We occasionally throw bare IOError objects (especially in convert),
don't choke on them.
This commit is contained in:
Matt Mackall 2014-07-01 19:54:48 -05:00
parent e3b09c4564
commit 8a748a627c

View File

@ -225,7 +225,8 @@ def _runcatch(req):
# it might be anything, for example a string
reason = inst.reason
ui.warn(_("abort: error: %s\n") % reason)
elif util.safehasattr(inst, "args") and inst.args[0] == errno.EPIPE:
elif (util.safehasattr(inst, "args")
and inst.args and inst.args[0] == errno.EPIPE):
if ui.debugflag:
ui.warn(_("broken pipe\n"))
elif getattr(inst, "strerror", None):