From: Antoine Pitrou Date: Thu, 5 Aug 2010 01:30:23 +0000 (+0000) Subject: Don't crash when the _ssl module isn't built X-Git-Tag: v2.7.1rc1~460 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=969fbe3d916c6dbb91c3d87f75f582f7cd317a2f;p=python Don't crash when the _ssl module isn't built --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index c95b93c907..a7bcf9434c 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: