comparison mercurial/commands.py @ 3077:e270cbd4aa20

Fixed OSError "No such file or directory: None" and make IOError consistent. The None error occurs when the current working directory is no longer available, e.g. because it was removed in another shell.
author Thomas Arendsen Hein <thomas@intevation.de>
date Mon, 11 Sep 2006 10:23:23 +0200
parents 4c9fcb5e3b82
children eeaf9bcdfa25
comparison
equal deleted inserted replaced
3076:4c9fcb5e3b82 3077:e270cbd4aa20
3471 elif hasattr(inst, "args") and inst[0] == errno.EPIPE: 3471 elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
3472 if u.debugflag: 3472 if u.debugflag:
3473 u.warn(_("broken pipe\n")) 3473 u.warn(_("broken pipe\n"))
3474 elif getattr(inst, "strerror", None): 3474 elif getattr(inst, "strerror", None):
3475 if getattr(inst, "filename", None): 3475 if getattr(inst, "filename", None):
3476 u.warn(_("abort: %s - %s\n") % (inst.strerror, inst.filename)) 3476 u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
3477 else: 3477 else:
3478 u.warn(_("abort: %s\n") % inst.strerror) 3478 u.warn(_("abort: %s\n") % inst.strerror)
3479 else: 3479 else:
3480 raise 3480 raise
3481 except OSError, inst: 3481 except OSError, inst:
3482 if hasattr(inst, "filename"): 3482 if getattr(inst, "filename", None):
3483 u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename)) 3483 u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
3484 else: 3484 else:
3485 u.warn(_("abort: %s\n") % inst.strerror) 3485 u.warn(_("abort: %s\n") % inst.strerror)
3486 except util.Abort, inst: 3486 except util.Abort, inst:
3487 u.warn(_("abort: %s\n") % inst) 3487 u.warn(_("abort: %s\n") % inst)