Show More
@@ -232,9 +232,9 def callcatch(ui, func): | |||
|
232 | 232 | elif m in "zlib".split(): |
|
233 | 233 | ui.error(_("(is your Python install correct?)\n")) |
|
234 | 234 | except IOError as inst: |
|
235 | if util.safehasattr(inst, "code"): | |
|
235 | if util.safehasattr(inst, "code"): # HTTPError | |
|
236 | 236 | ui.error(_("abort: %s\n") % stringutil.forcebytestr(inst)) |
|
237 | elif util.safehasattr(inst, "reason"): | |
|
237 | elif util.safehasattr(inst, "reason"): # URLError or SSLError | |
|
238 | 238 | try: # usually it is in the form (errno, strerror) |
|
239 | 239 | reason = inst.reason.args[1] |
|
240 | 240 | except (AttributeError, IndexError): |
@@ -247,14 +247,14 def callcatch(ui, func): | |||
|
247 | 247 | elif (util.safehasattr(inst, "args") |
|
248 | 248 | and inst.args and inst.args[0] == errno.EPIPE): |
|
249 | 249 | pass |
|
250 | elif getattr(inst, "strerror", None): | |
|
250 | elif getattr(inst, "strerror", None): # common IOError | |
|
251 | 251 | if getattr(inst, "filename", None): |
|
252 | 252 | ui.error(_("abort: %s: %s\n") % ( |
|
253 | 253 | encoding.strtolocal(inst.strerror), |
|
254 | 254 | stringutil.forcebytestr(inst.filename))) |
|
255 | 255 | else: |
|
256 | 256 | ui.error(_("abort: %s\n") % encoding.strtolocal(inst.strerror)) |
|
257 | else: | |
|
257 | else: # suspicious IOError | |
|
258 | 258 | raise |
|
259 | 259 | except OSError as inst: |
|
260 | 260 | if getattr(inst, "filename", None) is not None: |
General Comments 0
You need to be logged in to leave comments.
Login now