Mercurial > hg
diff mercurial/i18n.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 | 5bc7ff103081 |
children | dd83aafdb64a |
line wrap: on
line diff
--- a/mercurial/i18n.py Fri Jun 15 02:07:39 2018 +0530 +++ b/mercurial/i18n.py Wed Jun 13 22:51:08 2018 +0530 @@ -23,11 +23,6 @@ else: module = pycompat.fsencode(__file__) -try: - unicode -except NameError: - unicode = str - _languages = None if (pycompat.iswindows and 'LANGUAGE' not in encoding.environ @@ -76,7 +71,7 @@ cache = _msgcache.setdefault(encoding.encoding, {}) if message not in cache: - if type(message) is unicode: + if type(message) is pycompat.unicode: # goofy unicode docstrings in test paragraphs = message.split(u'\n\n') else: