mirror of
https://github.com/python/cpython.git
synced 2025-08-16 06:40:56 +00:00
Issue #9125: Update parser module for "except ... as ..." syntax.
This commit is contained in:
parent
2037913507
commit
070f0abc19
3 changed files with 14 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue