8000 [3.13] gh-122334: Fix test_embed failure when missing _ssl module (GH… · python/cpython@e808146 · GitHub
[go: up one dir, main page]

Skip to content

Commit e808146

Browse files
miss-islingtonneoneneWulian233
authored
[3.13] gh-122334: Fix test_embed failure when missing _ssl module (GH-122630) (#122647)
gh-122334: Fix test_embed failure when missing _ssl module (GH-122630) (cherry picked from commit 50b3603) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com> Co-authored-by: Wulian233 <1055917385@qq.com>
1 parent 24d15f0 commit e808146

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)
0