diff --git a/test/bytecode_pypy3.5/00_assign.pyc b/test/bytecode_pypy3.5/00_assign.pyc new file mode 100644 index 00000000..b6ad2b0a Binary files /dev/null and b/test/bytecode_pypy3.5/00_assign.pyc differ diff --git a/test/bytecode_pypy3.5/00_import.pyc b/test/bytecode_pypy3.5/00_import.pyc new file mode 100644 index 00000000..0198f100 Binary files /dev/null and b/test/bytecode_pypy3.5/00_import.pyc differ diff --git a/test/bytecode_pypy3.5/11_classbug.pyc b/test/bytecode_pypy3.5/11_classbug.pyc new file mode 100644 index 00000000..6c38f896 Binary files /dev/null and b/test/bytecode_pypy3.5/11_classbug.pyc differ diff --git a/uncompyle6/parsers/parse35.py b/uncompyle6/parsers/parse35.py index c6f8ccec..30db4fa7 100644 --- a/uncompyle6/parsers/parse35.py +++ b/uncompyle6/parsers/parse35.py @@ -144,9 +144,15 @@ class Python35Parser(Python34Parser): super(Python35Parser, self).customize_grammar_rules(tokens, customize) for i, token in enumerate(tokens): opname = token.kind + if opname == 'LOAD_ASSERT': + if 'PyPy' in customize: + rules_str = """ + stmt ::= JUMP_IF_NOT_DEBUG stmts COME_FROM + """ + self.add_unique_doc_rules(rules_str, customize) # FIXME: I suspect this is wrong for 3.6 and 3.5, but # I haven't verified what the 3.7ish fix is - if opname == 'BUILD_MAP_UNPACK_WITH_CALL': + elif opname == 'BUILD_MAP_UNPACK_WITH_CALL': if self.version < 3.7: self.addRule("expr ::= unmapexpr", nop_func) nargs = token.attr % 256 diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index d0518bbd..b644806a 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -188,13 +188,7 @@ class Python36Parser(Python35Parser): for i, token in enumerate(tokens): opname = token.kind - if opname == 'LOAD_ASSERT': - if 'PyPy' in customize: - rules_str = """ - stmt ::= JUMP_IF_NOT_DEBUG stmts COME_FROM - """ - self.add_unique_doc_rules(rules_str, customize) - elif opname == 'FORMAT_VALUE': + if opname == 'FORMAT_VALUE': rules_str = """ expr ::= formatted_value1 formatted_value1 ::= expr FORMAT_VALUE