comparison mercurial/scmutil.py @ 48934:06de08b36c82

py3: use str instead of pycompat.unicode pycompat.unicode is an alias to str. Differential Revision: https://phab.mercurial-scm.org/D12340
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 11:24:57 -0700
parents f254fc73d956
children 642e31cb55f0
comparison
equal deleted inserted replaced
48933:78f1de3f4be7 48934:06de08b36c82
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, pycompat.unicode): 230 if isinstance(reason, str):
231 # SSLError of Python 2.7.9 contains a unicode 231 # SSLError of Python 2.7.9 contains a unicode
232 reason = encoding.unitolocal(reason) 232 reason = encoding.unitolocal(reason)
233 ui.error(_(b"abort: error: %s\n") % stringutil.forcebytestr(reason)) 233 ui.error(_(b"abort: error: %s\n") % stringutil.forcebytestr(reason))
234 except (IOError, OSError) as inst: 234 except (IOError, OSError) as inst:
235 if ( 235 if (