]> granicus.if.org Git - python/commitdiff
Don't crash when the _ssl module isn't built
authorAntoine Pitrou <solipsis@pitrou.net>
Thu, 5 Aug 2010 01:30:23 +0000 (01:30 +0000)
committerAntoine Pitrou <solipsis@pitrou.net>
Thu, 5 Aug 2010 01:30:23 +0000 (01:30 +0000)
Lib/test/test_ssl.py

index c95b93c9072ccbf24bbd1186c1869eb8fd03bcef..a7bcf9434c72e25ca871f80ffd7504a8614a02bb 100644 (file)
@@ -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: