mirror of
https://github.com/python/cpython.git
synced 2026-01-08 00:12:42 +00:00
[3.13] gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) (GH-137275)
(cherry picked from commit 0282eef880)
Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
This commit is contained in:
parent
17392a71ae
commit
55f8fe548a
1 changed files with 6 additions and 1 deletions
|
|
@ -512,7 +512,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)
|
||||
|
||||
@contextlib.contextmanager
|
||||
def suppress_immortalization(suppress=True):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue