mercurial/commands.py
changeset 4010 e282448d68f1
parent 4009 86098ec4b77a
child 4013 54fa628b8c78
equal deleted inserted replaced
4009:86098ec4b77a 4010:e282448d68f1
  3275                 raise
  3275                 raise
  3276     except IOError, inst:
  3276     except IOError, inst:
  3277         if hasattr(inst, "code"):
  3277         if hasattr(inst, "code"):
  3278             u.warn(_("abort: %s\n") % inst)
  3278             u.warn(_("abort: %s\n") % inst)
  3279         elif hasattr(inst, "reason"):
  3279         elif hasattr(inst, "reason"):
  3280             u.warn(_("abort: error: %s\n") % inst.reason[1])
  3280             try: # usually it is in the form (errno, strerror)
       
  3281                 reason = inst.reason.args[1]
       
  3282             except: # it might be anything, for example a string
       
  3283                 reason = inst.reason
       
  3284             u.warn(_("abort: error: %s\n") % reason)
  3281         elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
  3285         elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
  3282             if u.debugflag:
  3286             if u.debugflag:
  3283                 u.warn(_("broken pipe\n"))
  3287                 u.warn(_("broken pipe\n"))
  3284         elif getattr(inst, "strerror", None):
  3288         elif getattr(inst, "strerror", None):
  3285             if getattr(inst, "filename", None):
  3289             if getattr(inst, "filename", None):