]> granicus.if.org Git - python/commitdiff
Do not fail if ssl fails to import
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 16 May 2010 20:35:03 +0000 (20:35 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 16 May 2010 20:35:03 +0000 (20:35 +0000)
Lib/test/test_ssl.py

index 36ed3aa91246dd9ae2c63b09bfbb301ee2d6a365..cf5abe2becad495b2efd94b0a0654b9192527113 100644 (file)
@@ -24,12 +24,13 @@ try:
     import ssl
 except ImportError:
     skip_expected = True
+else:
+    PROTOCOLS = [
+        ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3,
+        ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
+    ]
 
 HOST = support.HOST
-PROTOCOLS = [
-    ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3,
-    ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
-]
 
 data_file = lambda name: os.path.join(os.path.dirname(__file__), name)
 fsencode = lambda name: name.encode(sys.getfilesystemencoding(), "surrogateescape")