X Tutup
Skip to content

Commit 98a6f47

Browse files
committed
Python 2.2 scanner bug: don't mung IMPORT_NAME op
1 parent 2e3e665 commit 98a6f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uncompyle6/scanners/scanner26.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def disassemble(self, co, classname=None, code_objects={}, show_asm=None):
7979
'''
8080

8181
show_asm = self.show_asm if not show_asm else show_asm
82+
# show_asm = 'both'
8283
if show_asm in ('both', 'before'):
8384
from xdis.bytecode import Bytecode
8485
bytecode = Bytecode(co, self.opc)
@@ -160,7 +161,8 @@ def unmangle(name):
160161
self.opc.IMPORT_STAR))
161162
# Changes IMPORT_NAME to IMPORT_NAME_CONT.
162163
# Possibly a Python 2.0 hangover
163-
if len(imports) > 1 and self.version < 2.3:
164+
# FIXME: Move into a < 2.2 scanner.
165+
if len(imports) > 1 and self.version < 2.2:
164166
last_import = imports[0]
165167
for i in imports[1:]:
166168
if self.lines[last_import].next > i:

0 commit comments

Comments
 (0)
X Tutup