https://github.com/python/cpython/commit/7d57316484e4b8b07f1ca42829933c1808eaabb3
commit: 7d57316484e4b8b07f1ca42829933c1808eaabb3
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2025-08-05T20:34:47+03:00
summary:

[3.14] gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist 
(GH-137195) (#137274)

Co-authored-by: Jeong, YunWon <[email protected]>

files:
M Lib/test/support/__init__.py

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 9e08a7321be558..cd7f406565771b 100644
--- a/Lib/test/support/__init__.py
+++ b/Lib/test/support/__init__.py
@@ -544,7 +544,12 @@ def has_no_debug_ranges():
     return not bool(config['code_debug_ranges'])
 
 def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
-    return unittest.skipIf(has_no_debug_ranges(), reason)
+    try:
+        skip = has_no_debug_ranges()
+    except unittest.SkipTest as e:
+        skip = True
+        reason = e.args[0] if e.args else reason
+    return unittest.skipIf(skip, reason)
 
 
 MS_WINDOWS = (sys.platform == 'win32')

_______________________________________________
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