Skip to content

Commit 7d57316

Browse files
[3.14] gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) (#137274)
Co-authored-by: Jeong, YunWon <[email protected]>
1 parent f487008 commit 7d57316

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
@@ -544,7 +544,12 @@ def has_no_debug_ranges():
544544
return not bool(config['code_debug_ranges'])
545545

546546
def requires_debug_ranges(reason='requires co_positions / debug_ranges'):
547-
return unittest.skipIf(has_no_debug_ranges(), reason)
547+
try:
548+
skip = has_no_debug_ranges()
549+
except unittest.SkipTest as e:
550+
skip = True
551+
reason = e.args[0] if e.args else reason
552+
return unittest.skipIf(skip, reason)
548553

549554

550555
MS_WINDOWS = (sys.platform == 'win32')

0 commit comments

Comments
 (0)