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
--- 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.