pycompat: add xrange alias for Python 2
authorGregory Szorc <gregory.szorc@gmail.com>
Wed, 01 Aug 2018 12:57:15 -0700
changeset 38822 7eba8f83129b
parent 38821 0a57945aaf7f
child 38823 e7aa113b14f7
pycompat: add xrange alias for Python 2 We assign xrange on Python 3 but not Python 2. Adding the missing symbol on Python 2 allows us to use `pycompat.xrange` to get a generator range function. Differential Revision: https://phab.mercurial-scm.org/D4031
mercurial/pycompat.py
--- a/mercurial/pycompat.py	Tue Jul 31 19:37:54 2018 +0200
+++ b/mercurial/pycompat.py	Wed Aug 01 12:57:15 2018 -0700
@@ -331,6 +331,7 @@
 else:
     import cStringIO
 
+    xrange = xrange
     unicode = unicode
     bytechr = chr
     byterepr = repr