mirror of
https://github.com/python/cpython.git
synced 2025-08-14 22:01:08 +00:00
[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:
parent
b2779b2aa1
commit
4e4d35d332
4 changed files with 18 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue