Skip to content

Commit 55f8fe5

Browse files
[3.13] pythongh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (pythonGH-137195) (pythonGH-137275)
(cherry picked from commit 0282eef) Co-authored-by: Jeong, YunWon <[email protected]>
1 parent 17392a7 commit 55f8fe5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Lib/test/support/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,12 @@ def has_no_debug_ranges():
512512
return not bool(config['code_debug_ranges'])
513513

514514
def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
515-
return unittest.skipIf(has_no_debug_ranges(), reason)
515+
try:
516+
skip = has_no_debug_ranges()
517+
except unittest.SkipTest as e:
518+
skip = True
519+
reason = e.args[0] if e.args else reason
520+
return unittest.skipIf(skip, reason)
516521

517522
@contextlib.contextmanager
518523
def suppress_immortalization(suppress=True):

0 commit comments

Comments
 (0)