mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Fix code_offset_to_line handling
This commit is contained in:
1 parent
2b06a0b172
commit
47c2acd40e
1 file changed
+5
-1
Vendored
+5
-1
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user