diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index 19db79f8a161d5..4083044e743324 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -464,8 +464,12 @@ def test_getargs_reset_static_parser(self): # Test _PyArg_Parser initializations via _PyArg_UnpackKeywords() # https://github.com/python/cpython/issues/122334 code = textwrap.dedent(""" - import _ssl - _ssl.txt2obj(txt='1.3') + try: + import _ssl + except ModuleNotFoundError: + _ssl = None + if _ssl is not None: + _ssl.txt2obj(txt='1.3') print('1') import _queue