Fix Python 1.5 bytecode deparse

Need xdis 3.0.2 though since the bug is really there.
This commit is contained in:
rocky
2016-10-11 02:39:09 -04:00
parent bb8d0a6389
commit 9ef670c872
61 changed files with 13 additions and 10 deletions

View File

@@ -38,7 +38,7 @@ entry_points={
]}
ftp_url = None
install_requires = ['spark-parser >= 1.4.0',
'xdis >= 3.0.1']
'xdis >= 3.0.2']
license = 'MIT'
mailing_list = 'python-debugger@googlegroups.com'
modname = 'uncompyle6'

View File

@@ -1,2 +1,2 @@
spark-parser >= 1.4.0
xdis >= 3.0.1
xdis >= 3.0.2

View File

@@ -20,7 +20,7 @@ check:
$(MAKE) check-$$PYTHON_VERSION
#: Run working tests from Python 2.6 or 2.7
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-2.7-ok
check-2.6 check-2.7: check-bytecode-2 check-bytecode-3 check-bytecode-1 check-2.7-ok
#: Run working tests from Python 3.1
check-3.1: check-bytecode
@@ -50,6 +50,10 @@ check-3.6: check-bytecode
check-disasm:
$(PYTHON) dis-compare.py
#: Check deparsing bytecode 1.x only
check-bytecode-1:
$(PYTHON) test_pythonlib.py --bytecode-1.5
#: Check deparsing bytecode 2.x only
check-bytecode-2:
$(PYTHON) test_pythonlib.py \
@@ -65,7 +69,9 @@ check-bytecode-3:
check-bytecode: check-bytecode-3
$(PYTHON) test_pythonlib.py \
--bytecode-2.1 --bytecode-2.2 --bytecode-2.3 --bytecode-2.4 \
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 --bytecode-pypy2.7
--bytecode-2.5 --bytecode-2.6 --bytecode-2.7 \
--bytecode-pypy2.7 --bytecode-1
#: Check deparsing Python 2.1
check-bytecode-2.1:

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_1.5/exec.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_1.5/misc.pyc Normal file

Binary file not shown.

Binary file not shown.

BIN
test/bytecode_1.5/print.pyc Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -78,7 +78,8 @@ for vers in (2.7, 3.4, 3.5, 3.6):
test_options[key] = (os.path.join(src_dir, pythonlib), PYOC, key, vers)
pass
for vers in (2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7,
for vers in (1.5,
2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7,
3.1, 3.2, 3.3,
3.4, 3.5, 3.6, 'pypy3.2', 'pypy2.7'):
bytecode = "bytecode_%s" % vers

View File

@@ -224,11 +224,7 @@ class Scanner26(scan.Scanner2):
elif op in self.opc.hasjabs:
pattr = repr(oparg)
elif op in self.opc.haslocal:
if self.version >= 2.0:
pattr = varnames[oparg]
elif self.version < 2.0:
if oparg < len(names):
pattr = names[oparg]
elif op in self.opc.hascompare:
pattr = self.opc.cmp_op[oparg]
elif op in self.opc.hasfree: