bpo-43149: Correct the syntax error message for multiple exception types (GH-25996)

Automerge-Triggered-By: GH:pablogsal
This commit is contained in:
Pablo Galindo 2021-05-08 19:24:41 +01:00 committed by GitHub
parent 873275e64a
commit 6692dc1ca9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View file

@ -956,7 +956,7 @@ invalid_try_stmt:
RAISE_INDENTATION_ERROR("expected an indented block after 'try' statement on line %d", a->lineno) }
invalid_except_stmt:
| 'except' a=expression ',' expressions ['as' NAME ] ':' {
RAISE_SYNTAX_ERROR_STARTING_FROM(a, "exception group must be parenthesized") }
RAISE_SYNTAX_ERROR_STARTING_FROM(a, "multiple exception types must be parenthesized") }
| a='except' expression ['as' NAME ] NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
| a='except' NEWLINE { RAISE_SYNTAX_ERROR("expected ':'") }
invalid_finally_stmt: