diff mercurial/commands.py @ 3080: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
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 11 10:08:30 2006 +0200
+++ b/mercurial/commands.py	Mon Sep 11 10:23:23 2006 +0200
@@ -3473,13 +3473,13 @@
                 u.warn(_("broken pipe\n"))
         elif getattr(inst, "strerror", None):
             if getattr(inst, "filename", None):
-                u.warn(_("abort: %s - %s\n") % (inst.strerror, inst.filename))
+                u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
             else:
                 u.warn(_("abort: %s\n") % inst.strerror)
         else:
             raise
     except OSError, inst:
-        if hasattr(inst, "filename"):
+        if getattr(inst, "filename", None):
             u.warn(_("abort: %s: %s\n") % (inst.strerror, inst.filename))
         else:
             u.warn(_("abort: %s\n") % inst.strerror)