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

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 6692dc1ca9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
Miss Islington (bot) 2021-05-09 14:13:50 -07:00 committed by GitHub
parent c3eb3c18f1
commit 9a0e65c8e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 8 deletions

View file

@ -1068,7 +1068,7 @@ Make sure that the old "raise X, Y[, Z]" form is gone:
...
SyntaxError: invalid syntax
Check that an exception group with missing parentheses
Check that an multiple exception types with missing parentheses
raise a custom exception
>>> try:
@ -1076,21 +1076,21 @@ raise a custom exception
... except A, B:
... pass
Traceback (most recent call last):
SyntaxError: exception group must be parenthesized
SyntaxError: multiple exception types must be parenthesized
>>> try:
... pass
... except A, B, C:
... pass
Traceback (most recent call last):
SyntaxError: exception group must be parenthesized
SyntaxError: multiple exception types must be parenthesized
>>> try:
... pass
... except A, B, C as blech:
... pass
Traceback (most recent call last):
SyntaxError: exception group must be parenthesized
SyntaxError: multiple exception types must be parenthesized
>>> try:
... pass
@ -1099,7 +1099,7 @@ raise a custom exception
... finally:
... pass
Traceback (most recent call last):
SyntaxError: exception group must be parenthesized
SyntaxError: multiple exception types must be parenthesized
>>> f(a=23, a=234)