diff --git a/__pkginfo__.py b/__pkginfo__.py index 6eb7f0fa..35e15852 100644 --- a/__pkginfo__.py +++ b/__pkginfo__.py @@ -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' diff --git a/requirements.txt b/requirements.txt index 2204cd2b..522dc373 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ spark-parser >= 1.4.0 -xdis >= 3.0.1 +xdis >= 3.0.2 diff --git a/test/Makefile b/test/Makefile index 45627d34..6e74fc3e 100644 --- a/test/Makefile +++ b/test/Makefile @@ -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: diff --git a/test/bytecode_1.5/docstring.pyc b/test/bytecode_1.5/docstring.pyc new file mode 100644 index 00000000..8f854e6a Binary files /dev/null and b/test/bytecode_1.5/docstring.pyc differ diff --git a/test/bytecode_1.5/exceptions.pyc b/test/bytecode_1.5/exceptions.pyc new file mode 100644 index 00000000..441323ea Binary files /dev/null and b/test/bytecode_1.5/exceptions.pyc differ diff --git a/test/bytecode_1.5/exec.pyc b/test/bytecode_1.5/exec.pyc new file mode 100644 index 00000000..d1a50e6b Binary files /dev/null and b/test/bytecode_1.5/exec.pyc differ diff --git a/test/bytecode_1.5/expressions.pyc b/test/bytecode_1.5/expressions.pyc new file mode 100644 index 00000000..f0e90327 Binary files /dev/null and b/test/bytecode_1.5/expressions.pyc differ diff --git a/test/bytecode_1.5/globals.pyc b/test/bytecode_1.5/globals.pyc new file mode 100644 index 00000000..daf41ca6 Binary files /dev/null and b/test/bytecode_1.5/globals.pyc differ diff --git a/test/bytecode_1.5/import.pyc b/test/bytecode_1.5/import.pyc new file mode 100644 index 00000000..8ac4a885 Binary files /dev/null and b/test/bytecode_1.5/import.pyc differ diff --git a/test/bytecode_1.5/lambda.pyc b/test/bytecode_1.5/lambda.pyc new file mode 100644 index 00000000..7c91db54 Binary files /dev/null and b/test/bytecode_1.5/lambda.pyc differ diff --git a/test/bytecode_1.5/misc.pyc b/test/bytecode_1.5/misc.pyc new file mode 100644 index 00000000..d277f5ce Binary files /dev/null and b/test/bytecode_1.5/misc.pyc differ diff --git a/test/bytecode_1.5/nested_elif.pyc b/test/bytecode_1.5/nested_elif.pyc new file mode 100644 index 00000000..6c435962 Binary files /dev/null and b/test/bytecode_1.5/nested_elif.pyc differ diff --git a/test/bytecode_1.5/print.pyc b/test/bytecode_1.5/print.pyc new file mode 100644 index 00000000..e3c026c6 Binary files /dev/null and b/test/bytecode_1.5/print.pyc differ diff --git a/test/bytecode_1.5/slices.pyc b/test/bytecode_1.5/slices.pyc new file mode 100644 index 00000000..df820cb7 Binary files /dev/null and b/test/bytecode_1.5/slices.pyc differ diff --git a/test/bytecode_1.5/test_class.pyc b/test/bytecode_1.5/test_class.pyc new file mode 100644 index 00000000..e5c4da7a Binary files /dev/null and b/test/bytecode_1.5/test_class.pyc differ diff --git a/test/bytecode_1.5/test_class.pyo b/test/bytecode_1.5/test_class.pyo new file mode 100644 index 00000000..09df02ce Binary files /dev/null and b/test/bytecode_1.5/test_class.pyo differ diff --git a/test/bytecode_1.5/test_del.pyc b/test/bytecode_1.5/test_del.pyc new file mode 100644 index 00000000..19b1f2b1 Binary files /dev/null and b/test/bytecode_1.5/test_del.pyc differ diff --git a/test/bytecode_1.5/test_del.pyo b/test/bytecode_1.5/test_del.pyo new file mode 100644 index 00000000..31c60d48 Binary files /dev/null and b/test/bytecode_1.5/test_del.pyo differ diff --git a/test/bytecode_1.5/test_docstring.pyc b/test/bytecode_1.5/test_docstring.pyc new file mode 100644 index 00000000..abcde9ec Binary files /dev/null and b/test/bytecode_1.5/test_docstring.pyc differ diff --git a/test/bytecode_1.5/test_docstring.pyo b/test/bytecode_1.5/test_docstring.pyo new file mode 100644 index 00000000..d45970e8 Binary files /dev/null and b/test/bytecode_1.5/test_docstring.pyo differ diff --git a/test/bytecode_1.5/test_empty.pyc b/test/bytecode_1.5/test_empty.pyc new file mode 100644 index 00000000..83d39b5f Binary files /dev/null and b/test/bytecode_1.5/test_empty.pyc differ diff --git a/test/bytecode_1.5/test_empty.pyo b/test/bytecode_1.5/test_empty.pyo new file mode 100644 index 00000000..72e990db Binary files /dev/null and b/test/bytecode_1.5/test_empty.pyo differ diff --git a/test/bytecode_1.5/test_exceptions.pyc b/test/bytecode_1.5/test_exceptions.pyc new file mode 100644 index 00000000..825f5407 Binary files /dev/null and b/test/bytecode_1.5/test_exceptions.pyc differ diff --git a/test/bytecode_1.5/test_exceptions.pyo b/test/bytecode_1.5/test_exceptions.pyo new file mode 100644 index 00000000..8293491a Binary files /dev/null and b/test/bytecode_1.5/test_exceptions.pyo differ diff --git a/test/bytecode_1.5/test_exec.pyc b/test/bytecode_1.5/test_exec.pyc new file mode 100644 index 00000000..bc26d002 Binary files /dev/null and b/test/bytecode_1.5/test_exec.pyc differ diff --git a/test/bytecode_1.5/test_exec.pyo b/test/bytecode_1.5/test_exec.pyo new file mode 100644 index 00000000..f3deba86 Binary files /dev/null and b/test/bytecode_1.5/test_exec.pyo differ diff --git a/test/bytecode_1.5/test_expressions.pyc b/test/bytecode_1.5/test_expressions.pyc new file mode 100644 index 00000000..ba3c3f92 Binary files /dev/null and b/test/bytecode_1.5/test_expressions.pyc differ diff --git a/test/bytecode_1.5/test_expressions.pyo b/test/bytecode_1.5/test_expressions.pyo new file mode 100644 index 00000000..8b67e92d Binary files /dev/null and b/test/bytecode_1.5/test_expressions.pyo differ diff --git a/test/bytecode_1.5/test_functions.pyc b/test/bytecode_1.5/test_functions.pyc new file mode 100644 index 00000000..e7406020 Binary files /dev/null and b/test/bytecode_1.5/test_functions.pyc differ diff --git a/test/bytecode_1.5/test_functions.pyo b/test/bytecode_1.5/test_functions.pyo new file mode 100644 index 00000000..16db6c76 Binary files /dev/null and b/test/bytecode_1.5/test_functions.pyo differ diff --git a/test/bytecode_1.5/test_global.pyc b/test/bytecode_1.5/test_global.pyc new file mode 100644 index 00000000..c37e714d Binary files /dev/null and b/test/bytecode_1.5/test_global.pyc differ diff --git a/test/bytecode_1.5/test_global.pyo b/test/bytecode_1.5/test_global.pyo new file mode 100644 index 00000000..fcf37cd0 Binary files /dev/null and b/test/bytecode_1.5/test_global.pyo differ diff --git a/test/bytecode_1.5/test_globals.pyc b/test/bytecode_1.5/test_globals.pyc new file mode 100644 index 00000000..a631cd8d Binary files /dev/null and b/test/bytecode_1.5/test_globals.pyc differ diff --git a/test/bytecode_1.5/test_globals.pyo b/test/bytecode_1.5/test_globals.pyo new file mode 100644 index 00000000..4c6417cb Binary files /dev/null and b/test/bytecode_1.5/test_globals.pyo differ diff --git a/test/bytecode_1.5/test_import.pyc b/test/bytecode_1.5/test_import.pyc new file mode 100644 index 00000000..ebcd9208 Binary files /dev/null and b/test/bytecode_1.5/test_import.pyc differ diff --git a/test/bytecode_1.5/test_import.pyo b/test/bytecode_1.5/test_import.pyo new file mode 100644 index 00000000..31d6e714 Binary files /dev/null and b/test/bytecode_1.5/test_import.pyo differ diff --git a/test/bytecode_1.5/test_integers.pyc b/test/bytecode_1.5/test_integers.pyc new file mode 100644 index 00000000..b32aee1f Binary files /dev/null and b/test/bytecode_1.5/test_integers.pyc differ diff --git a/test/bytecode_1.5/test_integers.pyo b/test/bytecode_1.5/test_integers.pyo new file mode 100644 index 00000000..e7515a1a Binary files /dev/null and b/test/bytecode_1.5/test_integers.pyo differ diff --git a/test/bytecode_1.5/test_lambda.pyc b/test/bytecode_1.5/test_lambda.pyc new file mode 100644 index 00000000..85491f16 Binary files /dev/null and b/test/bytecode_1.5/test_lambda.pyc differ diff --git a/test/bytecode_1.5/test_lambda.pyo b/test/bytecode_1.5/test_lambda.pyo new file mode 100644 index 00000000..efc59078 Binary files /dev/null and b/test/bytecode_1.5/test_lambda.pyo differ diff --git a/test/bytecode_1.5/test_loops.pyc b/test/bytecode_1.5/test_loops.pyc new file mode 100644 index 00000000..ed7b87d0 Binary files /dev/null and b/test/bytecode_1.5/test_loops.pyc differ diff --git a/test/bytecode_1.5/test_loops.pyo b/test/bytecode_1.5/test_loops.pyo new file mode 100644 index 00000000..22b73a06 Binary files /dev/null and b/test/bytecode_1.5/test_loops.pyo differ diff --git a/test/bytecode_1.5/test_misc.pyc b/test/bytecode_1.5/test_misc.pyc new file mode 100644 index 00000000..81ab74f5 Binary files /dev/null and b/test/bytecode_1.5/test_misc.pyc differ diff --git a/test/bytecode_1.5/test_misc.pyo b/test/bytecode_1.5/test_misc.pyo new file mode 100644 index 00000000..d5f0812a Binary files /dev/null and b/test/bytecode_1.5/test_misc.pyo differ diff --git a/test/bytecode_1.5/test_nested_elif.pyc b/test/bytecode_1.5/test_nested_elif.pyc new file mode 100644 index 00000000..bb377027 Binary files /dev/null and b/test/bytecode_1.5/test_nested_elif.pyc differ diff --git a/test/bytecode_1.5/test_nested_elif.pyo b/test/bytecode_1.5/test_nested_elif.pyo new file mode 100644 index 00000000..cc45447d Binary files /dev/null and b/test/bytecode_1.5/test_nested_elif.pyo differ diff --git a/test/bytecode_1.5/test_prettyprint.pyc b/test/bytecode_1.5/test_prettyprint.pyc new file mode 100644 index 00000000..fc8fc65a Binary files /dev/null and b/test/bytecode_1.5/test_prettyprint.pyc differ diff --git a/test/bytecode_1.5/test_prettyprint.pyo b/test/bytecode_1.5/test_prettyprint.pyo new file mode 100644 index 00000000..06651c25 Binary files /dev/null and b/test/bytecode_1.5/test_prettyprint.pyo differ diff --git a/test/bytecode_1.5/test_print.pyc b/test/bytecode_1.5/test_print.pyc new file mode 100644 index 00000000..5de6fec4 Binary files /dev/null and b/test/bytecode_1.5/test_print.pyc differ diff --git a/test/bytecode_1.5/test_print.pyo b/test/bytecode_1.5/test_print.pyo new file mode 100644 index 00000000..00a7f65a Binary files /dev/null and b/test/bytecode_1.5/test_print.pyo differ diff --git a/test/bytecode_1.5/test_single_stmt.pyc b/test/bytecode_1.5/test_single_stmt.pyc new file mode 100644 index 00000000..8fa7697a Binary files /dev/null and b/test/bytecode_1.5/test_single_stmt.pyc differ diff --git a/test/bytecode_1.5/test_single_stmt.pyo b/test/bytecode_1.5/test_single_stmt.pyo new file mode 100644 index 00000000..f7bd2502 Binary files /dev/null and b/test/bytecode_1.5/test_single_stmt.pyo differ diff --git a/test/bytecode_1.5/test_slices.pyc b/test/bytecode_1.5/test_slices.pyc new file mode 100644 index 00000000..735082f8 Binary files /dev/null and b/test/bytecode_1.5/test_slices.pyc differ diff --git a/test/bytecode_1.5/test_slices.pyo b/test/bytecode_1.5/test_slices.pyo new file mode 100644 index 00000000..c6c4e4f5 Binary files /dev/null and b/test/bytecode_1.5/test_slices.pyo differ diff --git a/test/bytecode_1.5/test_tuple_params.pyc b/test/bytecode_1.5/test_tuple_params.pyc new file mode 100644 index 00000000..489ac085 Binary files /dev/null and b/test/bytecode_1.5/test_tuple_params.pyc differ diff --git a/test/bytecode_1.5/test_tuple_params.pyo b/test/bytecode_1.5/test_tuple_params.pyo new file mode 100644 index 00000000..6339b60f Binary files /dev/null and b/test/bytecode_1.5/test_tuple_params.pyo differ diff --git a/test/bytecode_1.5/test_tuples.pyc b/test/bytecode_1.5/test_tuples.pyc new file mode 100644 index 00000000..acdfbae5 Binary files /dev/null and b/test/bytecode_1.5/test_tuples.pyc differ diff --git a/test/bytecode_1.5/test_tuples.pyo b/test/bytecode_1.5/test_tuples.pyo new file mode 100644 index 00000000..5e09ef48 Binary files /dev/null and b/test/bytecode_1.5/test_tuples.pyo differ diff --git a/test/bytecode_1.5/tuple_params.pyc b/test/bytecode_1.5/tuple_params.pyc new file mode 100644 index 00000000..22178fb9 Binary files /dev/null and b/test/bytecode_1.5/tuple_params.pyc differ diff --git a/test/test_pythonlib.py b/test/test_pythonlib.py index 503e5cdf..3e960567 100755 --- a/test/test_pythonlib.py +++ b/test/test_pythonlib.py @@ -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 diff --git a/uncompyle6/scanners/scanner26.py b/uncompyle6/scanners/scanner26.py index 615def36..72b9f4bc 100755 --- a/uncompyle6/scanners/scanner26.py +++ b/uncompyle6/scanners/scanner26.py @@ -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] + pattr = varnames[oparg] elif op in self.opc.hascompare: pattr = self.opc.cmp_op[oparg] elif op in self.opc.hasfree: