# HG changeset patch # User Gregory Szorc # Date 1533154207 25200 # Node ID fb9121ea38c45e80b59005d8a968e5045b0bb17e # Parent 882ef6949bdc303f2dba206c8ab2743daf98439b 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 diff -r 882ef6949bdc -r fb9121ea38c4 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.