mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
bpo-30858: Improve error location for expressions with assignments (GH-23753)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
This commit is contained in:
parent
da431f789b
commit
43c4fb6c90
5 changed files with 15 additions and 6 deletions
|
@ -646,7 +646,7 @@ invalid_arguments:
|
|||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(a, "Generator expression must be parenthesized") }
|
||||
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
|
||||
invalid_kwarg:
|
||||
| a=expression '=' {
|
||||
| expression a='=' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
|
||||
a, "expression cannot contain assignment, perhaps you meant \"==\"?") }
|
||||
invalid_named_expression:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue