Skip to content

Commit fe90be4

Browse files
neoneneWulian233
authored andcommitted
pythongh-122334: Fix test_embed failure when missing _ssl module (pythonGH-122630)
Co-authored-by: Wulian233 <[email protected]>
1 parent fe713fc commit fe90be4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_embed.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,12 @@ def test_getargs_reset_static_parser(self):
465465
# Test _PyArg_Parser initializations via _PyArg_UnpackKeywords()
466466
# https://github.com/python/cpython/issues/122334
467467
code = textwrap.dedent("""
468-
import _ssl
469-
_ssl.txt2obj(txt='1.3')
468+
try:
469+
import _ssl
470+
except ModuleNotFoundError:
471+
_ssl = None
472+
if _ssl is not None:
473+
_ssl.txt2obj(txt='1.3')
470474
print('1')
471475
472476
import _queue

0 commit comments

Comments
 (0)