py3: move xrange alias next to import lines
Builtin functions should be available in compatibility code.
--- 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