diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2010-06-30 16:27:57 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2010-06-30 16:27:57 (GMT) |
commit | 070f0abc1978f87922cc200a6caeb37852d526ad (patch) | |
tree | db79608b2504e22d332e194a91aed0dd6d6ea9aa /Modules | |
parent | 20379135076182fc185fee15f918df6d44924d4c (diff) | |
download | cpython-070f0abc1978f87922cc200a6caeb37852d526ad.zip cpython-070f0abc1978f87922cc200a6caeb37852d526ad.tar.gz cpython-070f0abc1978f87922cc200a6caeb37852d526ad.tar.bz2 |
Issue #9125: Update parser module for "except ... as ..." syntax.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/parsermodule.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Modules/parsermodule.c b/Modules/parsermodule.c index c36fcb0..5d1bfb6 100644 --- a/Modules/parsermodule.c +++ b/Modules/parsermodule.c @@ -2126,10 +2126,13 @@ validate_except_clause(node *tree) if (res && (nch > 1)) res = validate_test(CHILD(tree, 1)); - if (res && (nch == 4)) - res = (validate_comma(CHILD(tree, 2)) - && validate_test(CHILD(tree, 3))); - + if (res && (nch == 4)) { + if (TYPE(CHILD(tree, 2)) == NAME) + res = validate_name(CHILD(tree, 2), "as"); + else + res = validate_comma(CHILD(tree, 2)); + res = res && validate_test(CHILD(tree, 3)); + } return (res); } |