Skip to content

Commit fdee843

Browse files
neoneneWulian233
authored andcommitted
pythongh-122334: Fix test_embed failure when missing _ssl module (pythonGH-122630)
(cherry picked from commit 50b3603) Co-authored-by: neonene <[email protected]> Co-authored-by: Wulian233 <[email protected]>
1 parent 545a328 commit fdee843

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
@@ -464,8 +464,12 @@ def test_getargs_reset_static_parser(self):
464464
# Test _PyArg_Parser initializations via _PyArg_UnpackKeywords()
465465
# https://github.com/python/cpython/issues/122334
466466
code = textwrap.dedent("""
467-
import _ssl
468-
_ssl.txt2obj(txt='1.3')
467+
try:
468+
import _ssl
469+
except ModuleNotFoundError:
470+
_ssl = None
471+
if _ssl is not None:
472+
_ssl.txt2obj(txt='1.3')
469473
print('1')
470474
471475
import _queue

0 commit comments

Comments
 (0)