mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
[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 50b3603751
)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Co-authored-by: Wulian233 <1055917385@qq.com>
This commit is contained in:
parent
1c4d08d73e
commit
b895f1804f
1 changed files with 6 additions and 2 deletions
|
@ -438,8 +438,12 @@ class EmbeddingTests(EmbeddingTestsMixin, unittest.TestCase):
|
||||||
# Test _PyArg_Parser initializations via _PyArg_UnpackKeywords()
|
# Test _PyArg_Parser initializations via _PyArg_UnpackKeywords()
|
||||||
# https://github.com/python/cpython/issues/122334
|
# https://github.com/python/cpython/issues/122334
|
||||||
code = textwrap.dedent("""
|
code = textwrap.dedent("""
|
||||||
import _ssl
|
try:
|
||||||
_ssl.txt2obj(txt='1.3')
|
import _ssl
|
||||||
|
except ModuleNotFoundError:
|
||||||
|
_ssl = None
|
||||||
|
if _ssl is not None:
|
||||||
|
_ssl.txt2obj(txt='1.3')
|
||||||
print('1')
|
print('1')
|
||||||
|
|
||||||
import _queue
|
import _queue
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue