Mercurial > hg
comparison mercurial/scmutil.py @ 38312:79dd61a4554f
py3: replace `unicode` with pycompat.unicode
unicode() is not available on Python 3 and throws a NameError because unicodes
are now default str() on py3.
Differential Revision: https://phab.mercurial-scm.org/D3708
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 13 Jun 2018 22:51:08 +0530 |
parents | d0abd7949ea3 |
children | cf59de802883 |
comparison
equal
deleted
inserted
replaced
38311:47f5454a30ed | 38312:79dd61a4554f |
---|---|
231 try: # usually it is in the form (errno, strerror) | 231 try: # usually it is in the form (errno, strerror) |
232 reason = inst.reason.args[1] | 232 reason = inst.reason.args[1] |
233 except (AttributeError, IndexError): | 233 except (AttributeError, IndexError): |
234 # it might be anything, for example a string | 234 # it might be anything, for example a string |
235 reason = inst.reason | 235 reason = inst.reason |
236 if isinstance(reason, unicode): | 236 if isinstance(reason, pycompat.unicode): |
237 # SSLError of Python 2.7.9 contains a unicode | 237 # SSLError of Python 2.7.9 contains a unicode |
238 reason = encoding.unitolocal(reason) | 238 reason = encoding.unitolocal(reason) |
239 ui.warn(_("abort: error: %s\n") % reason) | 239 ui.warn(_("abort: error: %s\n") % reason) |
240 elif (util.safehasattr(inst, "args") | 240 elif (util.safehasattr(inst, "args") |
241 and inst.args and inst.args[0] == errno.EPIPE): | 241 and inst.args and inst.args[0] == errno.EPIPE): |