[PATCH 1 of 5] hghave: add test for Python 2.7+

Gregory Szorc gregory.szorc at gmail.com
Sun Jul 17 14:28:24 EDT 2016


# HG changeset patch
# User Gregory Szorc <gregory.szorc at gmail.com>
# Date 1468777851 25200
#      Sun Jul 17 10:50:51 2016 -0700
# Node ID 470e0f20a6337e0518e3348ee1538eed54270f1f
# Parent  1cc5a918b7d8acdc918809d74842fecc128c4ec4
hghave: add test for Python 2.7+

Setting ciphers in the ssl module requires Python 2.7. Surprisingly,
we didn't have a test for running on Python 2.7.

diff --git a/tests/hghave.py b/tests/hghave.py
--- a/tests/hghave.py
+++ b/tests/hghave.py
@@ -518,16 +518,20 @@ def has_debhelper():
     return dpkg and dh and dh_py2
 
 @check("absimport", "absolute_import in __future__")
 def has_absimport():
     import __future__
     from mercurial import util
     return util.safehasattr(__future__, "absolute_import")
 
+ at check("py27+", "running with Python 2.7+")
+def has_python27ornewer():
+    return sys.version_info[0:2] >= (2, 7)
+
 @check("py3k", "running with Python 3.x")
 def has_py3k():
     return 3 == sys.version_info[0]
 
 @check("py3exe", "a Python 3.x interpreter is available")
 def has_python3exe():
     return 'PYTHON3' in os.environ
 


More information about the Mercurial-devel mailing list