https://github.com/python/cpython/commit/0282eef880c8c8db782a2088b0257250e0f76d48
commit: 0282eef880c8c8db782a2088b0257250e0f76d48
branch: main
author: Jeong, YunWon <69878+youknow...@users.noreply.github.com>
committer: serhiy-storchaka <storch...@gmail.com>
date: 2025-07-31T14:22:11+03:00
summary:

gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195)

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

diff --git a/Lib/test/support/__init__.py b/Lib/test/support/__init__.py
index 100438bf71d3a6..cea2f09aae5d51 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 -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: arch...@mail-archive.com

Reply via email to