Mercurial > hg
comparison mercurial/scmutil.py @ 32152:994b0b1c77d6
py3: use encoding.unitolocal instead of .encode(encoding.encoding)
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Sat, 08 Apr 2017 11:02:37 +0530 |
parents | ef966bcf48a5 |
children | 448ed4d3ee90 |
comparison
equal
deleted
inserted
replaced
32151:4d504e541d3d | 32152:994b0b1c77d6 |
---|---|
210 except (AttributeError, IndexError): | 210 except (AttributeError, IndexError): |
211 # it might be anything, for example a string | 211 # it might be anything, for example a string |
212 reason = inst.reason | 212 reason = inst.reason |
213 if isinstance(reason, unicode): | 213 if isinstance(reason, unicode): |
214 # SSLError of Python 2.7.9 contains a unicode | 214 # SSLError of Python 2.7.9 contains a unicode |
215 reason = reason.encode(encoding.encoding, 'replace') | 215 reason = encoding.unitolocal(reason) |
216 ui.warn(_("abort: error: %s\n") % reason) | 216 ui.warn(_("abort: error: %s\n") % reason) |
217 elif (util.safehasattr(inst, "args") | 217 elif (util.safehasattr(inst, "args") |
218 and inst.args and inst.args[0] == errno.EPIPE): | 218 and inst.args and inst.args[0] == errno.EPIPE): |
219 pass | 219 pass |
220 elif getattr(inst, "strerror", None): | 220 elif getattr(inst, "strerror", None): |