Address long-standing Python 2.6 try/except bug

Fixes #405
This commit is contained in:
rocky
2024-07-11 13:59:16 -04:00
parent b0b67e9f34
commit 6fe8a1d2ba
3 changed files with 38 additions and 0 deletions

View File

@@ -130,6 +130,10 @@ class Python26Parser(Python2Parser):
# Semantic actions want else_suitel to be at index 3
ifelsestmtl ::= testexpr c_stmts_opt cf_jb_cf_pop else_suitel
ifelsestmtc ::= testexpr c_stmts_opt ja_cf_pop else_suitec
ifelsestmt ::= testexpr stmts_opt ja_cf_pop else_suite
# The last except of a "try: ... except" can do this...
except_suite ::= stmts_opt COME_FROM JUMP_ABSOLUTE POP_TOP
# Semantic actions want suite_stmts_opt to be at index 3
with ::= expr setupwith SETUP_FINALLY suite_stmts_opt