mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210)
This commit is contained in:
parent
24ccc89547
commit
33c0c90dea
4 changed files with 1334 additions and 1284 deletions
|
@ -843,7 +843,7 @@ invalid_arguments:
|
|||
RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, asdl_seq_GET(b, b->size-1)->target, "Generator expression must be parenthesized") }
|
||||
| a=args ',' args { _PyPegen_arguments_parsing_error(p, a) }
|
||||
invalid_kwarg:
|
||||
| a=expression b='=' {
|
||||
| !(NAME '=') a=expression b='=' {
|
||||
RAISE_SYNTAX_ERROR_KNOWN_RANGE(
|
||||
a, b, "expression cannot contain assignment, perhaps you meant \"==\"?") }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue