diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-05 01:30:23 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-08-05 01:30:23 (GMT) |
commit | 969fbe3d916c6dbb91c3d87f75f582f7cd317a2f (patch) | |
tree | de90f76fe6d9b01d98fb2e9302cc94ee8bca36ee /Lib/test/test_ssl.py | |
parent | 33e5935b536cc0562bcb38cf1a3895a4b4075383 (diff) | |
download | cpython-969fbe3d916c6dbb91c3d87f75f582f7cd317a2f.zip cpython-969fbe3d916c6dbb91c3d87f75f582f7cd317a2f.tar.gz cpython-969fbe3d916c6dbb91c3d87f75f582f7cd317a2f.tar.bz2 |
Don't crash when the _ssl module isn't built
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index c95b93c..a7bcf94 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -60,7 +60,11 @@ class BasicTests(unittest.TestCase): def skip_if_broken_ubuntu_ssl(func): # We need to access the lower-level wrapper in order to create an # implicit SSL context without trying to connect or listen. - import _ssl + try: + import _ssl + except ImportError: + # The returned function won't get executed, just ignore the error + pass @functools.wraps(func) def f(*args, **kwargs): try: |