py3: stop rewriting xrange() to pycompat.xrange()
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 01 Aug 2018 13:10:07 -0700
changeset 38785 fb9121ea38c4
parent 38784 882ef6949bdc
child 38786 28d8b5f49b4d
py3: stop rewriting xrange() to pycompat.xrange() We now require the use of pycompat.xrange() in source. One less feature in the module importer gets us one step closer to Python 3 native source code. Differential Revision: https://phab.mercurial-scm.org/D4034
mercurial/__init__.py
--- a/mercurial/__init__.py	Wed Aug 01 13:08:00 2018 -0700
+++ b/mercurial/__init__.py	Wed Aug 01 13:10:07 2018 -0700
@@ -182,7 +182,7 @@
                     continue
                 r, c = t.start
                 l = (b'; from mercurial.pycompat import '
-                     b'delattr, getattr, hasattr, setattr, xrange, '
+                     b'delattr, getattr, hasattr, setattr, '
                      b'open, unicode\n')
                 for u in tokenize.tokenize(io.BytesIO(l).readline):
                     if u.type in (tokenize.ENCODING, token.ENDMARKER):
@@ -223,7 +223,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\x0a'
+    BYTECODEHEADER = b'HG\x00\x0b'
 
     class hgloader(importlib.machinery.SourceFileLoader):
         """Custom module loader that transforms source code.