diff options
author | neonene <53406459+neonene@users.noreply.github.com> | 2024-08-03 13:15:26 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-03 13:15:26 (GMT) |
commit | 50b36037518a8e7f7eee39b597d56b5b2756eb86 (patch) | |
tree | 41e9ecacc66e0abcccb45d63b50df2f9252abfb4 /Lib/test | |
parent | cc6839a1810290e483e5d5f0786d9b46c4294d47 (diff) | |
download | cpython-50b36037518a8e7f7eee39b597d56b5b2756eb86.zip cpython-50b36037518a8e7f7eee39b597d56b5b2756eb86.tar.gz cpython-50b36037518a8e7f7eee39b597d56b5b2756eb86.tar.bz2 |
gh-122334: Fix test_embed failure when missing _ssl module (GH-122630)
Co-authored-by: Wulian233 <1055917385@qq.com>
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_embed.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py index ab112d6..916a9a7 100644 --- a/Lib/test/test_embed.py +++ b/Lib/test/test_embed.py @@ -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 |