Skip to content

Commit 36cc6d1

Browse files
committed
Backport CPython gh-137195
python/cpython#137195
1 parent f32a5b1 commit 36cc6d1

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

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

519524
@contextlib.contextmanager
520525
def suppress_immortalization(suppress=True):

0 commit comments

Comments
 (0)