Commit 05d936d2 authored by Antoine Pitrou's avatar Antoine Pitrou

Let test_ssl fail gracefully if ssl support is not available

parent f26f87ef
...@@ -18,17 +18,12 @@ import weakref ...@@ -18,17 +18,12 @@ import weakref
import platform import platform
import functools import functools
# Optionally test SSL support, if we have it in the tested platform ssl = support.import_module("ssl")
skip_expected = False
try: PROTOCOLS = [
import ssl ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3,
except ImportError: ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
skip_expected = True ]
else:
PROTOCOLS = [
ssl.PROTOCOL_SSLv2, ssl.PROTOCOL_SSLv3,
ssl.PROTOCOL_SSLv23, ssl.PROTOCOL_TLSv1
]
HOST = support.HOST HOST = support.HOST
...@@ -1489,9 +1484,6 @@ else: ...@@ -1489,9 +1484,6 @@ else:
def test_main(verbose=False): def test_main(verbose=False):
if skip_expected:
raise unittest.SkipTest("No SSL support")
if support.verbose: if support.verbose:
plats = { plats = {
'Linux': platform.linux_distribution, 'Linux': platform.linux_distribution,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment