diff options
| author | Pablo Galindo Salgado <Pablogsal@gmail.com> | 2021-07-27 21:30:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-27 21:30:32 +0100 |
| commit | ecc3c8e4216958d85385bf2467441c975128f26c (patch) | |
| tree | cba394460a49c48aee128b4c9fe1b87c83b0b770 /Grammar/python.gram | |
| parent | 6948964ecf94e858448dd28eea634317226d2913 (diff) | |
| download | cpython-git-ecc3c8e4216958d85385bf2467441c975128f26c.tar.gz | |
bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392)
Diffstat (limited to 'Grammar/python.gram')
| -rw-r--r-- | Grammar/python.gram | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram index 7b8af046ea..8219add900 100644 --- a/Grammar/python.gram +++ b/Grammar/python.gram @@ -848,9 +848,10 @@ expression_without_invalid[expr_ty]: | disjunction | lambdef invalid_legacy_expression: - | a=NAME b=expression_without_invalid { - _PyPegen_check_legacy_stmt(p, a) ? RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, "Missing parentheses in call to '%U'.", a->v.Name.id) : NULL} - + | a=NAME b=star_expressions { + _PyPegen_check_legacy_stmt(p, a) ? RAISE_SYNTAX_ERROR_KNOWN_RANGE(a, b, + "Missing parentheses in call to '%U'. Did you mean %U(...)?", a->v.Name.id, a->v.Name.id) : NULL} + invalid_expression: | invalid_legacy_expression # !(NAME STRING) is not matched so we don't show this error with some invalid string prefixes like: kf"dsfsdf" |
