mercurial/i18n.py
changeset 28674 03d1ecbbd81e
parent 25955 2c07c6884394
child 29415 47fb4beb992b
--- a/mercurial/i18n.py	Mon Mar 28 22:30:23 2016 +0000
+++ b/mercurial/i18n.py	Tue Mar 29 17:22:08 2016 +0000
@@ -20,6 +20,10 @@
 else:
     module = __file__
 
+try:
+    unicode
+except NameError:
+    unicode = str
 
 _languages = None
 if (os.name == 'nt'
@@ -45,7 +49,10 @@
     localedir = os.path.join(datapath, 'locale')
     t = gettextmod.translation('hg', localedir, _languages, fallback=True)
     global _ugettext
-    _ugettext = t.ugettext
+    try:
+        _ugettext = t.ugettext
+    except AttributeError:
+        _ugettext = t.gettext
 
 _msgcache = {}