Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix code_offset_to_line handling
  • Loading branch information
youknowone committed Mar 16, 2026
commit 47c2acd40e7107a1716655a2c8d9c9435231e27a
6 changes: 5 additions & 1 deletion Lib/test/test_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,10 @@
from test.support import threading_helper, import_helper
from test.support.bytecode_helper import instructions_with_positions
from opcode import opmap, opname
from _testcapi import code_offset_to_line
try:
from _testcapi import code_offset_to_line
except ModuleNotFoundError:
code_offset_to_line = None
try:
import _testinternalcapi
except ModuleNotFoundError:
Expand Down Expand Up @@ -1490,6 +1493,7 @@ async def async_func():

rc, out, err = assert_python_ok('-OO', '-c', code)

@unittest.skipUnless(code_offset_to_line, '_testcapi required')
def test_co_branches(self):

def get_line_branches(func):
Expand Down