Skip to content

Commit bf69805

Browse files
miss-islingtonyouknowone
authored andcommitted
[3.14] pythongh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (pythonGH-137195) (python#137274)
Co-authored-by: Jeong, YunWon <[email protected]>
1 parent 187fdf8 commit bf69805

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)