summaryrefslogtreecommitdiffstats
path: root/Grammar/python.gram
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2021-05-19 18:03:04 (GMT)
committerGitHub <noreply@github.com>2021-05-19 18:03:04 (GMT)
commit33c0c90dea06fda1df99482521559ebef7210bea (patch)
tree109035144aecedfa8dbf63ab2d2c0cd5b396568d /Grammar/python.gram
parent24ccc89547a6ebac058b2c56db4ad4142fdbebea (diff)
downloadcpython-33c0c90dea06fda1df99482521559ebef7210bea.zip
cpython-33c0c90dea06fda1df99482521559ebef7210bea.tar.gz
cpython-33c0c90dea06fda1df99482521559ebef7210bea.tar.bz2
bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210)
Diffstat (limited to 'Grammar/python.gram')
-rw-r--r--Grammar/python.gram2
1 files changed, 1 insertions, 1 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 6b815ab..9a53fe0 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 \"==\"?") }