comparison mercurial/commands.py @ 1350:3729e2773cca

Fix pipe error regression
author Matt Mackall <mpm@selenic.com>
date Mon, 26 Sep 2005 14:01:18 -0700
parents 5a42da1db402
children 8cf364c65425
comparison
equal deleted inserted replaced
1349:c6295d2a361e 1350:3729e2773cca
2172 except IOError, inst: 2172 except IOError, inst:
2173 if hasattr(inst, "code"): 2173 if hasattr(inst, "code"):
2174 u.warn("abort: %s\n" % inst) 2174 u.warn("abort: %s\n" % inst)
2175 elif hasattr(inst, "reason"): 2175 elif hasattr(inst, "reason"):
2176 u.warn("abort: error: %s\n" % inst.reason[1]) 2176 u.warn("abort: error: %s\n" % inst.reason[1])
2177 elif getattr(inst, "strerror", None):
2178 u.warn("abort: %s\n" % inst.strerror)
2179 elif hasattr(inst, "args") and inst[0] == errno.EPIPE: 2177 elif hasattr(inst, "args") and inst[0] == errno.EPIPE:
2180 if u.debugflag: 2178 if u.debugflag:
2181 u.warn("broken pipe\n") 2179 u.warn("broken pipe\n")
2180 elif getattr(inst, "strerror", None):
2181 u.warn("abort: %s\n" % inst.strerror)
2182 else: 2182 else:
2183 raise 2183 raise
2184 except OSError, inst: 2184 except OSError, inst:
2185 if hasattr(inst, "filename"): 2185 if hasattr(inst, "filename"):
2186 u.warn("abort: %s: %s\n" % (inst.strerror, inst.filename)) 2186 u.warn("abort: %s: %s\n" % (inst.strerror, inst.filename))