mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
bpo-40176: Improve error messages for trailing comma on from import (GH-20294)
This commit is contained in:
parent
d10fef35c6
commit
72e0aa2fd2
3 changed files with 220 additions and 151 deletions
|
@ -641,6 +641,14 @@ SyntaxError: cannot assign to f-string expression
|
|||
Traceback (most recent call last):
|
||||
SyntaxError: cannot assign to f-string expression
|
||||
|
||||
>>> from t import x,
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: trailing comma not allowed without surrounding parentheses
|
||||
|
||||
>>> from t import x,y,
|
||||
Traceback (most recent call last):
|
||||
SyntaxError: trailing comma not allowed without surrounding parentheses
|
||||
|
||||
Corner-cases that used to fail to raise the correct error:
|
||||
|
||||
>>> def f(*, x=lambda __debug__:0): pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue