mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Don't crash when the _ssl module isn't built
This commit is contained in:
parent
33e5935b53
commit
969fbe3d91
1 changed files with 5 additions and 1 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue