diff hgext/convert/common.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 bfdd20d22a86
children 2dd9519b8c8a
line wrap: on
line diff
--- a/hgext/convert/common.py	Fri Jun 15 02:07:39 2018 +0530
+++ b/hgext/convert/common.py	Wed Jun 13 22:51:08 2018 +0530
@@ -214,7 +214,7 @@
         if not encoding:
             encoding = self.encoding or 'utf-8'
 
-        if isinstance(s, unicode):
+        if isinstance(s, pycompat.unicode):
             return s.encode("utf-8")
         try:
             return s.decode(pycompat.sysstr(encoding)).encode("utf-8")