]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
In verbose mode, identify OpenSSL build and platform more precisely
authorAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 16:45:21 +0000 (16:45 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Wed, 4 Aug 2010 16:45:21 +0000 (16:45 +0000)
Lib/test/test_ssl.py

index 9c0d263e0f1e634eeaf746c1ef81e714ec37d5e5..26fcf1b8ff5fd2abc44626a3ae2771dcac4c4daa 100644 (file)
@@ -15,6 +15,7 @@ import urllib.parse, urllib.request
 import traceback
 import asyncore
 import weakref
+import platform
 
 from http.server import HTTPServer, SimpleHTTPRequestHandler
 
@@ -1424,6 +1425,23 @@ def test_main(verbose=False):
     if skip_expected:
         raise unittest.SkipTest("No SSL support")
 
+    if support.verbose:
+        plats = {
+            'Linux': platform.linux_distribution,
+            'Mac': platform.mac_ver,
+            'Windows': platform.win32_ver,
+        }
+        for name, func in plats.items():
+            plat = func()
+            if plat and plat[0]:
+                plat = '%s %r' % (name, plat)
+                break
+        else:
+            plat = repr(platform.platform())
+        print("test_ssl: testing with %r %r" %
+            (ssl.OPENSSL_VERSION, ssl.OPENSSL_VERSION_INFO))
+        print("          under %s" % plat)
+
     for filename in [
         CERTFILE, SVN_PYTHON_ORG_ROOT_CERT, BYTES_CERTFILE,
         ONLYCERT, ONLYKEY, BYTES_ONLYCERT, BYTES_ONLYKEY,