summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-16 20:35:03 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-16 20:35:03 (GMT)
commit27ba6388ed932af9e2c91e21d1ed3f260437e377 (patch)
treea54b1ad27bddee04e3e402416097c3e3cc0885d0 /Lib
parent65ec8ae47fa4bb0a3c2ef815ca1b03f3519398bc (diff)
downloadcpython-27ba6388ed932af9e2c91e21d1ed3f260437e377.zip
cpython-27ba6388ed932af9e2c91e21d1ed3f260437e377.tar.gz
cpython-27ba6388ed932af9e2c91e21d1ed3f260437e377.tar.bz2
Do not fail if ssl fails to import
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_ssl.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py
index 36ed3aa..cf5abe2 100644
--- a/Lib/test/test_ssl.py
+++ b/Lib/test/test_ssl.py
@@ -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")