Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-…
…137195)

(cherry picked from commit 0282eef)

Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
  • Loading branch information
youknowone authored and miss-islington committed Jul 31, 2025
commit 5eec6b6ca6542479e0aceedf48df9cdf6875856c
7 changes: 6 additions & 1 deletion Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Loading