diff --git a/Makefile b/Makefile index b4a1c346..a1f1324a 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ check-2.6: #:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4] # Skip for now -2.6 5.0: +2.4 2.6 5.0: #: Run py.test tests pytest: diff --git a/test/Makefile b/test/Makefile index 1ba3cca9..ed53cac0 100644 --- a/test/Makefile +++ b/test/Makefile @@ -112,7 +112,7 @@ check-3.4-ok: #:PyPy of some sort. E.g. [PyPy 5.0.1 with GCC 4.8.4] # Skip for now -2.6 5.0: +2.4 2.6 5.0: clean: clean-py-dis clean-dis clean-unverified diff --git a/test/bytecode_pypy3.2/06_setif_comprehension.pyc-notyet b/test/bytecode_pypy3.2/06_setif_comprehension.pyc-notyet deleted file mode 100644 index b708b743..00000000 Binary files a/test/bytecode_pypy3.2/06_setif_comprehension.pyc-notyet and /dev/null differ diff --git a/uncompyle6/parsers/parse2.py b/uncompyle6/parsers/parse2.py index 6e0e6b28..16e4dcee 100644 --- a/uncompyle6/parsers/parse2.py +++ b/uncompyle6/parsers/parse2.py @@ -270,6 +270,8 @@ class Python2Parser(PythonParser): # A PyPy speciality self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD", op, v, customize) + self.add_unique_rule("load_attr ::= LOAD_NAME LOOKUP_METHOD", + op, v, customize) self.add_unique_rule("call_function ::= expr CALL_METHOD", op, v, customize) continue diff --git a/uncompyle6/parsers/parse3.py b/uncompyle6/parsers/parse3.py index b1a430e6..59b93d23 100644 --- a/uncompyle6/parsers/parse3.py +++ b/uncompyle6/parsers/parse3.py @@ -470,6 +470,8 @@ class Python3Parser(PythonParser): # A PyPy speciality self.add_unique_rule("load_attr ::= LOAD_FAST LOOKUP_METHOD", opname, token.attr, customize) + self.add_unique_rule("load_attr ::= LOAD_NAME LOOKUP_METHOD", + opname, token.attr, customize) self.add_unique_rule("call_function ::= expr CALL_METHOD", opname, token.attr, customize) continue diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index 7887fd13..bb1eb5f4 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -128,6 +128,7 @@ class Scanner3(scan.Scanner): for instr in bytecode.get_instructions(co): print(instr._disassemble()) + customize = {} # Container for tokens tokens = [] @@ -235,6 +236,8 @@ class Scanner3(scan.Scanner): elif op in self.varargs: pos_args = inst.argval opname = '%s_%d' % (opname, pos_args) + elif self.is_pypy and opname == 'CALL_METHOD': + customize['CALL_METHOD'] = argval elif opname == 'UNPACK_EX': # FIXME: try with scanner and parser by # changing inst.argval @@ -296,7 +299,7 @@ class Scanner3(scan.Scanner): for t in tokens: print(t.format()) print() - return tokens, {} + return tokens, customize def build_lines_data(self, code_obj): """