bild_lines API changed. Adjust test for change

This commit is contained in:
rocky
2018-02-25 21:27:09 -05:00
parent f6aa775d58
commit 493835b8cd
2 changed files with 3 additions and 4 deletions

View File

@@ -28,7 +28,7 @@ def test_if_in_for():
if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY: if 2.7 <= PYTHON_VERSION <= 3.0 and not IS_PYPY:
n = scan.setup_code(code) n = scan.setup_code(code)
bytecode = Bytecode(code, scan.opc) bytecode = Bytecode(code, scan.opc)
scan.build_lines_data(code, n) scan.lines = scan.build_lines_data(code, n)
scan.insts = list(bytecode) scan.insts = list(bytecode)
scan.offset2inst_index = {} scan.offset2inst_index = {}
for i, inst in enumerate(scan.insts): for i, inst in enumerate(scan.insts):
@@ -50,7 +50,7 @@ def test_if_in_for():
code = bug_loop.__code__ code = bug_loop.__code__
n = scan.setup_code(code) n = scan.setup_code(code)
bytecode = Bytecode(code, scan.opc) bytecode = Bytecode(code, scan.opc)
scan.build_lines_data(code, n) scan.lines = scan.build_lines_data(code, n)
scan.insts = list(bytecode) scan.insts = list(bytecode)
scan.build_prev_op(n) scan.build_prev_op(n)
scan.offset2inst_index = {} scan.offset2inst_index = {}
@@ -71,7 +71,7 @@ def test_if_in_for():
elif 3.2 < PYTHON_VERSION <= 3.4: elif 3.2 < PYTHON_VERSION <= 3.4:
bytecode = Bytecode(code, scan.opc) bytecode = Bytecode(code, scan.opc)
scan.code = array('B', code.co_code) scan.code = array('B', code.co_code)
scan.build_lines_data(code) scan.lines = scan.build_lines_data(code)
scan.build_prev_op() scan.build_prev_op()
scan.insts = list(bytecode) scan.insts = list(bytecode)
scan.offset2inst_index = {} scan.offset2inst_index = {}

View File

@@ -402,7 +402,6 @@ class Scanner3(Scanner):
# as CONTINUE, but that's okay since we add a grammar # as CONTINUE, but that's okay since we add a grammar
# rule for that. # rule for that.
pattr = argval pattr = argval
# FIXME: 0 isn't always correct
target = self.get_target(inst.offset) target = self.get_target(inst.offset)
if target <= inst.offset: if target <= inst.offset:
next_opname = self.insts[i+1].opname next_opname = self.insts[i+1].opname