Another 2.6 try parse bug

This commit is contained in:
rocky
2018-03-06 18:19:01 -05:00
parent ccd42077c1
commit 01ad91b519
2 changed files with 14 additions and 2 deletions

View File

@@ -21,7 +21,6 @@ def call(*args):
except KeyError:
return 2
except TypeError:
# Unhashable argument
return 3
@@ -39,3 +38,16 @@ def do_jump(self, arg):
arg(3)
except ValueError:
arg(4)
# From 2.6.9 smtpd.py
# Bug was that the for can cause multiple COME_FROMs at the
# of the try block
def _deliver(self, s, mailfrom, rcpttos):
try:
mailfrom(1)
except RuntimeError:
mailfrom(2)
except IndexError:
for r in s:
mailfrom()
return

View File

@@ -22,7 +22,7 @@ class Python26Parser(Python2Parser):
JUMP_IF_FALSE POP_TOP POP_TOP store POP_TOP
except_handler ::= JUMP_FORWARD COME_FROM except_stmts
come_from_pop END_FINALLY come_froms
come_froms_pop END_FINALLY come_froms
except_handler ::= JUMP_FORWARD COME_FROM except_stmts END_FINALLY
come_froms