You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
bild_lines API changed. Adjust test for change
This commit is contained in:
@@ -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 = {}
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user