setup: fix mistake that prevented Python 3 from being excluded stable
authorAugie Fackler <augie@google.com>
Wed, 26 Jul 2017 13:21:34 -0400
branchstable
changeset 33591 ee11d18fcd3c
parent 33590 52f82e7d6a7e
child 33592 cc96449f00c9
setup: fix mistake that prevented Python 3 from being excluded My intent was to only allow Python 3 if the right environment variable is set (for when people want to use `pip install .` on hg locally). This fixes the bug in my previous change. I verified that `python3.6 run-tests.py` still passes the tests that passed before, and that all tests pass on 2.7 (including our virtualenv-using installation test). Differential Revision: https://phab.mercurial-scm.org/D185
setup.py
--- a/setup.py	Mon Jul 24 23:52:56 2017 -0700
+++ b/setup.py	Wed Jul 26 13:21:34 2017 -0400
@@ -4,8 +4,10 @@
 # 'python setup.py install', or
 # 'python setup.py --help' for more options
 
+import os
+
 supportedpy = '~= 2.7'
-if 'HGALLOWPYTHON3':
+if os.environ.get('HGALLOWPYTHON3', ''):
     # Mercurial will never work on Python 3 before 3.5 due to a lack
     # of % formatting on bytestrings, and can't work on 3.6.0 or 3.6.1
     # due to a bug in % formatting in bytestrings.
@@ -101,7 +103,7 @@
 ispypy = "PyPy" in sys.version
 
 import ctypes
-import os, stat, subprocess, time
+import stat, subprocess, time
 import re
 import shutil
 import tempfile