Fix code_offset_to_line handling

This commit is contained in:
Jeong, YunWon committed 2026-03-16 15:25:29 +09:00
1 parent 2b06a0b172
commit 47c2acd40e
1 file changed
+5 -1
+5 -1
View File
@@ -215,7 +215,10 @@ from test.support.script_helper import assert_python_ok
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:
@@ -1490,6 +1493,7 @@ class CodeLocationTest(unittest.TestCase):
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):