Mercurial > public > mercurial-scm > hg
diff hgext/phabricator.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 |
line wrap: on
line diff
--- a/hgext/phabricator.py Tue Mar 08 10:58:22 2022 +0100 +++ b/hgext/phabricator.py Mon Feb 21 11:24:57 2022 -0700 @@ -219,9 +219,7 @@ rawparams = encoding.unifromlocal(wdirvfs.read(b".arcconfig")) # json.loads only returns unicode strings arcconfig = pycompat.rapply( - lambda x: encoding.unitolocal(x) - if isinstance(x, pycompat.unicode) - else x, + lambda x: encoding.unitolocal(x) if isinstance(x, str) else x, pycompat.json_loads(rawparams), ) @@ -447,9 +445,7 @@ time.sleep(retry_interval) ui.debug(b'Conduit Response: %s\n' % body) parsed = pycompat.rapply( - lambda x: encoding.unitolocal(x) - if isinstance(x, pycompat.unicode) - else x, + lambda x: encoding.unitolocal(x) if isinstance(x, str) else x, # json.loads only accepts bytes from py3.6+ pycompat.json_loads(encoding.unifromlocal(body)), ) @@ -473,9 +469,7 @@ rawparams = encoding.unifromlocal(ui.fin.read()) # json.loads only returns unicode strings params = pycompat.rapply( - lambda x: encoding.unitolocal(x) - if isinstance(x, pycompat.unicode) - else x, + lambda x: encoding.unitolocal(x) if isinstance(x, str) else x, pycompat.json_loads(rawparams), ) # json.dumps only accepts unicode strings