mirror of
https://github.com/python/cpython.git
synced 2026-02-10 11:51:07 +00:00
bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26247)
(cherry picked from commit 33c0c90dea)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
This commit is contained in:
parent
e87fd41d02
commit
ec0699c044
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