https://github.com/python/cpython/commit/b895f1804ffd220768d2caff23363740bd2c9b01
commit: b895f1804ffd220768d2caff23363740bd2c9b01
branch: 3.12
author: Miss Islington (bot) <[email protected]>
committer: Yhg1s <[email protected]>
date: 2024-08-06T20:59:55+02:00
summary:

[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 50b36037518a8e7f7eee39b597d56b5b2756eb86)

Co-authored-by: neonene <[email protected]>
Co-authored-by: Wulian233 <[email protected]>

files:
M Lib/test/test_embed.py

diff --git a/Lib/test/test_embed.py b/Lib/test/test_embed.py
index 5ce23223a0f97f..13713cf37b83a4 100644
--- a/Lib/test/test_embed.py
+++ b/Lib/test/test_embed.py
@@ -438,8 +438,12 @@ def test_getargs_reset_static_parser(self):
         # 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

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to