equal
deleted
inserted
replaced
225 try: # usually it is in the form (errno, strerror) |
225 try: # usually it is in the form (errno, strerror) |
226 reason = inst.reason.args[1] |
226 reason = inst.reason.args[1] |
227 except (AttributeError, IndexError): |
227 except (AttributeError, IndexError): |
228 # it might be anything, for example a string |
228 # it might be anything, for example a string |
229 reason = inst.reason |
229 reason = inst.reason |
|
230 if isinstance(reason, unicode): |
|
231 # SSLError of Python 2.7.9 contains a unicode |
|
232 reason = reason.encode(encoding.encoding, 'replace') |
230 ui.warn(_("abort: error: %s\n") % reason) |
233 ui.warn(_("abort: error: %s\n") % reason) |
231 elif (util.safehasattr(inst, "args") |
234 elif (util.safehasattr(inst, "args") |
232 and inst.args and inst.args[0] == errno.EPIPE): |
235 and inst.args and inst.args[0] == errno.EPIPE): |
233 if ui.debugflag: |
236 if ui.debugflag: |
234 ui.warn(_("broken pipe\n")) |
237 ui.warn(_("broken pipe\n")) |