From 9d3e4a66604b95dc2cc453c2d939ce3692657d39 Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 4 Jun 2018 02:09:48 -0400 Subject: [PATCH] Some Python 1.4 fixes --- uncompyle6/parser.py | 6 +++--- uncompyle6/parsers/parse14.py | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/uncompyle6/parser.py b/uncompyle6/parser.py index 318faad9..114231c5 100644 --- a/uncompyle6/parser.py +++ b/uncompyle6/parser.py @@ -622,11 +622,11 @@ def get_python_parser( if version < 3.0: if version < 2.2: if version == 1.4: - import uncompyle6.parsers.parse15 as parse14 + import uncompyle6.parsers.parse14 as parse14 if compile_mode == 'exec': - p = parse14.Python15Parser(debug_parser) + p = parse14.Python14Parser(debug_parser) else: - p = parse14.Python15ParserSingle(debug_parser) + p = parse14.Python14ParserSingle(debug_parser) elif version == 1.5: import uncompyle6.parsers.parse15 as parse15 if compile_mode == 'exec': diff --git a/uncompyle6/parsers/parse14.py b/uncompyle6/parsers/parse14.py index 702e69cc..d1c3fc62 100644 --- a/uncompyle6/parsers/parse14.py +++ b/uncompyle6/parsers/parse14.py @@ -15,6 +15,14 @@ class Python14Parser(Python15Parser): # FIXME: should check that this indeed around __doc__ stmt ::= doc_junk doc_junk ::= LOAD_CONST POP_TOP + + # Not sure why later Python's omit the COME_FROM + jb_pop14 ::= JUMP_BACK COME_FROM POP_TOP + + whileelsestmt ::= SETUP_LOOP testexpr l_stmts_opt + jb_pop14 + POP_BLOCK else_suitel COME_FROM + """ def __init__(self, debug_parser=PARSER_DEFAULT_DEBUG):