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

login
register
mail settings
Submitter Gregory Szorc
Date July 17, 2016, 6:28 p.m.
Message ID <470e0f20a6337e0518e3.1468780104@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/15915/
State Accepted
Headers show

Comments

Gregory Szorc - July 17, 2016, 6:28 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@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.

Patch

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")
 
+@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