Skip to content

Commit b895f18

Browse files
miss-islingtonneoneneWulian233
authored
[3.12] gh-122334: Fix test_embed failure when missing _ssl module (GH-122630) (#122648)
gh-122334: Fix test_embed failure when missing _ssl module (GH-122630) (cherry picked from commit 50b3603) Co-authored-by: neonene <[email protected]> Co-authored-by: Wulian233 <[email protected]>
1 parent 1c4d08d commit b895f18

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
@@ -438,8 +438,12 @@ def test_getargs_reset_static_parser(self):
438438
# Test _PyArg_Parser initializations via _PyArg_UnpackKeywords()
439439
# https://github.com/python/cpython/issues/122334
440440
code = textwrap.dedent("""
441-
import _ssl
442-
_ssl.txt2obj(txt='1.3')
441+
try:
442+
import _ssl
443+
except ModuleNotFoundError:
444+
_ssl = None
445+
if _ssl is not None:
446+
_ssl.txt2obj(txt='1.3')
443447
print('1')
444448
445449
import _queue

0 commit comments

Comments
 (0)