[PATCH 3 of 5 V2] py3: check python version to enable builtins hack
Yuya Nishihara
yuya at tcha.org
Tue Aug 16 04:50:44 EDT 2016
# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1471146253 -32400
# Sun Aug 14 12:44:13 2016 +0900
# Node ID c3639410ef41ee95ce795ac1a461889feb9f9cf5
# Parent 72d31f469f3b89eddd3f138af567bed3a9fac0a7
py3: check python version to enable builtins hack
Future patches will add (del|get|has|set)attr wrappers.
diff --git a/mercurial/pycompat.py b/mercurial/pycompat.py
--- a/mercurial/pycompat.py
+++ b/mercurial/pycompat.py
@@ -29,9 +29,7 @@ else:
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
More information about the Mercurial-devel
mailing list