hghave: we now support Python 2.7.9's ssl for https
authorAugie Fackler <augie@google.com>
Tue, 13 Jan 2015 15:08:55 -0500
changeset 23825 b2358bc1407c
parent 23824 e278fc8bb0c3
child 23827 4982fade9733
hghave: we now support Python 2.7.9's ssl for https
tests/hghave.py
--- a/tests/hghave.py	Tue Jan 13 14:15:08 2015 -0500
+++ b/tests/hghave.py	Tue Jan 13 15:08:55 2015 -0500
@@ -307,11 +307,13 @@
     return not matchoutput('hg root 2>&1',
                            r'abort: no repository found', True)
 
-@check("ssl", "python >= 2.6 ssl module and python OpenSSL")
+@check("ssl", ("(python >= 2.6 ssl module and python OpenSSL) "
+               "OR python >= 2.7.9 ssl"))
 def has_ssl():
     try:
         import ssl
-        ssl.wrap_socket # silence unused import warning
+        if getattr(ssl, 'create_default_context', False):
+            return True
         import OpenSSL
         OpenSSL.SSL.Context
         return True