diff --git a/test/bytecode_3.0/05_abc_test.pyc b/test/bytecode_3.0/05_abc_test.pyc new file mode 100644 index 00000000..0194ca87 Binary files /dev/null and b/test/bytecode_3.0/05_abc_test.pyc differ diff --git a/uncompyle6/parsers/parse30.py b/uncompyle6/parsers/parse30.py index 9ca1c4ac..5f2b7f37 100644 --- a/uncompyle6/parsers/parse30.py +++ b/uncompyle6/parsers/parse30.py @@ -29,7 +29,8 @@ class Python30Parser(Python31Parser): # Specifically POP_TOP is more prevelant since there is no POP_JUMP_IF_... # instructions - _ifstmts_jump ::= c_stmts_opt JUMP_FORWARD _come_froms POP_TOP COME_FROM + _ifstmts_jump ::= c_stmts JUMP_FORWARD _come_froms POP_TOP COME_FROM + _ifstmts_jump ::= c_stmts POP_TOP # Used to keep index order the same in semantic actions jb_pop_top ::= JUMP_BACK POP_TOP diff --git a/uncompyle6/semantics/customize3.py b/uncompyle6/semantics/customize3.py index 6cd41e65..1c7f0974 100644 --- a/uncompyle6/semantics/customize3.py +++ b/uncompyle6/semantics/customize3.py @@ -156,6 +156,22 @@ def customize_for_version3(self, version): self.prune() self.n_classdef3 = n_classdef3 + if version == 3.0: + # In Python 3.0 there is code to move from _[dd] into + # the iteration variable. These rules we can ignore + # since we pick up the iteration variable some other way and + # we definitely don't include in the source _[dd]. + def n_comp_iter(node): + if node[0] == 'expr': + n = node[0][0] + if (n == 'LOAD_FAST' and + n.pattr[0:2] == '_['): + self.prune() + pass + pass + # Not this special case, procede as normal... + self.default(node) + self.n_comp_iter = n_comp_iter if version >= 3.3: def n_yield_from(node):