gh-122334: Fix test_embed failure when missing _ssl module (GH-122630)

Co-authored-by: Wulian233 <1055917385@qq.com>
This commit is contained in:
neonene 2024-08-03 22:15:26 +09:00 committed by GitHub
parent cc6839a181
commit 50b3603751
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -465,8 +465,12 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
# 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