pycompat: alias xrange to range in py3
authortimeless <timeless@mozdev.org>
Wed, 06 Apr 2016 22:35:52 +0000
changeset 28834 2fac032c1269
parent 28833 672fc23bf9cc
child 28835 68a946e83188
pycompat: alias xrange to range in py3
mercurial/pycompat.py
--- a/mercurial/pycompat.py	Fri Apr 08 14:03:05 2016 +0000
+++ b/mercurial/pycompat.py	Wed Apr 06 22:35:52 2016 +0000
@@ -17,3 +17,9 @@
     import queue as _queue
 empty = _queue.Empty
 queue = _queue.Queue
+
+try:
+    xrange
+except NameError:
+    import builtins
+    builtins.xrange = range