summaryrefslogtreecommitdiffstats
path: root/Grammar
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-05-19 18:26:59 (GMT)
committerGitHub <noreply@github.com>2021-05-19 18:26:59 (GMT)
commitd4a9264ab899b4f3088b5afad8956123924a5ab1 (patch)
tree9b1607476d45fc76cd255086e70a7ea718d27565 /Grammar
parent509e1c9d35ab3cb9814aaeb5324258298ce481e9 (diff)
downloadcpython-d4a9264ab899b4f3088b5afad8956123924a5ab1.zip
cpython-d4a9264ab899b4f3088b5afad8956123924a5ab1.tar.gz
cpython-d4a9264ab899b4f3088b5afad8956123924a5ab1.tar.bz2
[3.9] bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26250)
(cherry picked from commit 33c0c90dea06fda1df99482521559ebef7210bea) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 64e205e..0e12b5c 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -633,7 +633,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 '=' {
+ | !(NAME '=') a=expression b='=' {
RAISE_SYNTAX_ERROR_KNOWN_LOCATION(
a, "expression cannot contain assignment, perhaps you meant \"==\"?") }
invalid_named_expression: