bpo-34013: Don't consider a grouped expression when reporting legacy print syntax errors (GH-27521)

This commit is contained in:
Pablo Galindo Salgado 2021-08-01 02:10:50 +01:00 committed by GitHub
parent b08c48e617
commit 208a7e957b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View file

@ -1073,7 +1073,7 @@ expression_without_invalid[expr_ty]:
| disjunction
| lambdef
invalid_legacy_expression:
| a=NAME b=star_expressions {
| 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}