Skip to content

Commit b0b67e9

Browse files
committed
Fix some 2.6 bytecode bugs
scanner26: disassemble interface has changed make_function2: was missing ParserError2 import
1 parent 3c6e378 commit b0b67e9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

uncompyle6/scanners/scanner26.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,15 @@ def ingest(self, co, classname=None, code_objects={}, show_asm=None):
8181
# show_asm = 'after'
8282
if show_asm in ("both", "before"):
8383
print("\n# ---- disassembly:")
84-
for instr in bytecode.get_instructions(co):
85-
print(instr.disassemble(self.opc))
86-
84+
bytecode.disassemble_bytes(
85+
co.co_code,
86+
varnames=co.co_varnames,
87+
names=co.co_names,
88+
constants=co.co_consts,
89+
cells=bytecode._cell_names,
90+
line_starts=bytecode._linestarts,
91+
asm_format="extended",
92+
)
8793
# Container for tokens
8894
tokens = []
8995

uncompyle6/semantics/make_function2.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
from xdis import code_has_star_arg, code_has_star_star_arg, iscode
2424

25+
from uncompyle6.parser import ParserError as ParserError2
2526
from uncompyle6.scanner import Code
2627
from uncompyle6.semantics.helper import (
2728
find_all_globals,

0 commit comments

Comments
 (0)