diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-05-19 18:03:04 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-19 18:03:04 (GMT) |
commit | 33c0c90dea06fda1df99482521559ebef7210bea (patch) | |
tree | 109035144aecedfa8dbf63ab2d2c0cd5b396568d /Grammar/python.gram | |
parent | 24ccc89547a6ebac058b2c56db4ad4142fdbebea (diff) | |
download | cpython-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.gram | 2 |
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 \"==\"?") } |