changeset 29798:31d588fcd2b9

py3: check python version to enable builtins hack Future patches will add (del|get|has|set)attr wrappers.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 14 Aug 2016 12:44:13 +0900
parents 965c91bad9e3
children 45fa8de47a0f
files mercurial/pycompat.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/pycompat.py	Sun Aug 14 12:41:54 2016 +0900
+++ b/mercurial/pycompat.py	Sun Aug 14 12:44:13 2016 +0900
@@ -29,9 +29,7 @@
     import urllib.parse as urlparse
     import xmlrpc.client as xmlrpclib
 
-try:
-    xrange
-except NameError:
+if sys.version_info[0] >= 3:
     import builtins
     builtins.xrange = range