diff --git a/uncompyle6/parsers/parse36.py b/uncompyle6/parsers/parse36.py index f87da84b3..96a6a3766 100644 --- a/uncompyle6/parsers/parse36.py +++ b/uncompyle6/parsers/parse36.py @@ -33,6 +33,10 @@ def p_36misc(self, args): """ sstmt ::= sstmt RETURN_LAST + cf_for_iter ::= _come_froms FOR_ITER + list_for ::= expr cf_for_iter store list_iter jb_or_c + genexpr_func ::= LOAD_FAST cf_for_iter store comp_iter JUMP_BACK + # 3.6 redoes how return_closure works. FIXME: Isolate to LOAD_CLOSURE return_closure ::= LOAD_CLOSURE DUP_TOP STORE_NAME RETURN_VALUE RETURN_LAST diff --git a/uncompyle6/scanners/scanner3.py b/uncompyle6/scanners/scanner3.py index eec5f43cf..a9d8d8af7 100644 --- a/uncompyle6/scanners/scanner3.py +++ b/uncompyle6/scanners/scanner3.py @@ -811,7 +811,13 @@ def detect_control_flow(self, offset, targets, inst_index): self.fixed_jumps[offset] = fix or match[-1] return else: - self.fixed_jumps[offset] = match[-1] + if self.version < 3.6: + # FIXME: this is putting in COME_FROMs in the wrong place. + # Fix up grammar so we don't need to do this. + # See cf_for_iter use in parser36.py + self.fixed_jumps[offset] = match[-1] + else: + self.fixed_jumps[offset] = target return # op == POP_JUMP_IF_TRUE else: diff --git a/uncompyle6/semantics/pysource.py b/uncompyle6/semantics/pysource.py index f11f1fdaf..5be529880 100644 --- a/uncompyle6/semantics/pysource.py +++ b/uncompyle6/semantics/pysource.py @@ -1433,7 +1433,7 @@ def print_super_classes3(self, node): assert node[n].kind.startswith('CALL_FUNCTION') if node[n].kind.startswith('CALL_FUNCTION_KW'): - # 3.6+ starts does this + # 3.6+ starts doing this kwargs = node[n-1].attr assert isinstance(kwargs, tuple) i = n - (len(kwargs)+1)