[3.9] bpo-44947: Refine the syntax error for trailing commas in import statements (GH-27814) (GH-27817)

(cherry picked from commit b2f68b1900)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
Łukasz Langa 2021-08-18 23:03:59 +02:00 committed by GitHub
parent b2779b2aa1
commit 4e4d35d332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 6 deletions

View file

@ -727,6 +727,13 @@ SyntaxError: trailing comma not allowed without surrounding parentheses
Traceback (most recent call last):
SyntaxError: trailing comma not allowed without surrounding parentheses
# Check that we dont raise the "trailing comma" error if there is more
# input to the left of the valid part that we parsed.
>>> from t import x,y, and 3
Traceback (most recent call last):
SyntaxError: invalid syntax
>>> (): int
Traceback (most recent call last):
SyntaxError: only single target (not tuple) can be annotated