Python3 try/except handling improvements. Add Walker exception and use

that: fixes erroneous uncompyle success message on parse error.
This commit is contained in:
rocky
2015-12-26 00:12:02 -05:00
parent 0409cee6a9
commit fe9c8d5734
7 changed files with 74 additions and 35 deletions

View File

@@ -449,6 +449,7 @@ class Python3Parser(PythonParser):
except_stmt ::= except_cond1 except_suite
except_stmt ::= except_cond2 except_suite
except_stmt ::= except_cond2 except_suite_finalize
except_stmt ::= except
# Python3 introduced POP_EXCEPT
@@ -457,10 +458,11 @@ class Python3Parser(PythonParser):
# This is used in Python 3 in
# "except ... as e" to remove 'e' after the c_stmts_opt finishes
except_suite ::= SETUP_FINALLY c_stmts_opt
POP_BLOCK POP_EXCEPT LOAD_CONST COME_FROM LOAD_CONST
STORE_NAME DELETE_NAME END_FINALLY
JUMP_FORWARD
except_suite_finalize ::= SETUP_FINALLY c_stmts_opt except_var_finalize
END_FINALLY JUMP_FORWARD
except_var_finalize ::= POP_BLOCK POP_EXCEPT LOAD_CONST COME_FROM LOAD_CONST
designator del_stmt
except_suite ::= return_stmts