diff mercurial/__init__.py @ 31843:526e4597cca5

py3: add pycompat.unicode and add it to importer On python 3, builtins.unicode does not exist.
author Pulkit Goyal <7895pulkit@gmail.com>
date Fri, 07 Apr 2017 23:35:51 +0530
parents 83e080144faf
children 65cd7e705ff6
line wrap: on
line diff
--- a/mercurial/__init__.py	Fri Apr 07 16:00:44 2017 +0530
+++ b/mercurial/__init__.py	Fri Apr 07 23:35:51 2017 +0530
@@ -283,7 +283,8 @@
                     continue
                 r, c = t.start
                 l = (b'; from mercurial.pycompat import '
-                     b'delattr, getattr, hasattr, setattr, xrange, open\n')
+                     b'delattr, getattr, hasattr, setattr, xrange, '
+                     b'open, unicode\n')
                 for u in tokenize.tokenize(io.BytesIO(l).readline):
                     if u.type in (tokenize.ENCODING, token.ENDMARKER):
                         continue
@@ -323,7 +324,7 @@
     # ``replacetoken`` or any mechanism that changes semantics of module
     # loading is changed. Otherwise cached bytecode may get loaded without
     # the new transformation mechanisms applied.
-    BYTECODEHEADER = b'HG\x00\x09'
+    BYTECODEHEADER = b'HG\x00\x0a'
 
     class hgloader(importlib.machinery.SourceFileLoader):
         """Custom module loader that transforms source code.