From ec0699c044b4272a1face752fd39b8230f96c0da Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Wed, 19 May 2021 11:28:31 -0700 Subject: bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26247) (cherry picked from commit 33c0c90dea06fda1df99482521559ebef7210bea) Co-authored-by: Pablo Galindo Co-authored-by: Pablo Galindo --- Grammar/python.gram | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Grammar/python.gram') diff --git a/Grammar/python.gram b/Grammar/python.gram index 6b815ab0c5..9a53fe023d 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -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 \"==\"?") } -- cgit v1.2.1