changeset 29808:965c91bad9e3

py3: move xrange alias next to import lines Builtin functions should be available in compatibility code.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Aug 2016 12:41:54 +0900
parents 6ab838b20359
children 31d588fcd2b9
files mercurial/pycompat.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pycompat.py	Tue Aug 16 17:15:54 2016 +0900
+++ b/mercurial/pycompat.py	Sun Aug 14 12:41:54 2016 +0900
@@ -29,6 +29,12 @@
     import urllib.parse as urlparse
     import xmlrpc.client as xmlrpclib
 
+try:
+    xrange
+except NameError:
+    import builtins
+    builtins.xrange = range
+
 stringio = io.StringIO
 empty = _queue.Empty
 queue = _queue.Queue
@@ -143,9 +149,3 @@
         "SimpleHTTPRequestHandler",
         "CGIHTTPRequestHandler",
     ))
-
-try:
-    xrange
-except NameError:
-    import builtins
-    builtins.xrange = range