diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2021-07-27 21:19:18 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 21:19:18 (GMT) |
commit | 68e3dca0687c4c8e61ed98aed82f81049880c0ce (patch) | |
tree | 09303b22a3cfb3c9e788ceb4219840200ff42b00 /Parser | |
parent | b977f8510e2ff4f11e3bda920722098a242fc8cc (diff) | |
download | cpython-68e3dca0687c4c8e61ed98aed82f81049880c0ce.zip cpython-68e3dca0687c4c8e61ed98aed82f81049880c0ce.tar.gz cpython-68e3dca0687c4c8e61ed98aed82f81049880c0ce.tar.bz2 |
bpo-34013: Move the Python 2 hints from the exception constructor to the parser (GH-27392)
(cherry picked from commit ecc3c8e4216958d85385bf2467441c975128f26c)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/parser.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Parser/parser.c b/Parser/parser.c index 80e4fc9..cda5c63 100644 --- a/Parser/parser.c +++ b/Parser/parser.c @@ -18180,7 +18180,7 @@ expression_without_invalid_rule(Parser *p) return _res; } -// invalid_legacy_expression: NAME expression_without_invalid +// invalid_legacy_expression: NAME star_expressions static void * invalid_legacy_expression_rule(Parser *p) { @@ -18191,22 +18191,22 @@ invalid_legacy_expression_rule(Parser *p) } void * _res = NULL; int _mark = p->mark; - { // NAME expression_without_invalid + { // NAME star_expressions if (p->error_indicator) { D(p->level--); return NULL; } - D(fprintf(stderr, "%*c> invalid_legacy_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME expression_without_invalid")); + D(fprintf(stderr, "%*c> invalid_legacy_expression[%d-%d]: %s\n", p->level, ' ', _mark, p->mark, "NAME star_expressions")); expr_ty a; expr_ty b; if ( (a = _PyPegen_name_token(p)) // NAME && - (b = expression_without_invalid_rule(p)) // expression_without_invalid + (b = star_expressions_rule(p)) // star_expressions ) { - D(fprintf(stderr, "%*c+ invalid_legacy_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME expression_without_invalid")); - _res = _PyPegen_check_legacy_stmt ( p , a ) ? RAISE_SYNTAX_ERROR_KNOWN_RANGE ( a , b , "Missing parentheses in call to '%U'." , a -> v . Name . id ) : NULL; + D(fprintf(stderr, "%*c+ invalid_legacy_expression[%d-%d]: %s succeeded!\n", p->level, ' ', _mark, p->mark, "NAME star_expressions")); + _res = _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; if (_res == NULL && PyErr_Occurred()) { p->error_indicator = 1; D(p->level--); @@ -18216,7 +18216,7 @@ invalid_legacy_expression_rule(Parser *p) } p->mark = _mark; D(fprintf(stderr, "%*c%s invalid_legacy_expression[%d-%d]: %s failed!\n", p->level, ' ', - p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME expression_without_invalid")); + p->error_indicator ? "ERROR!" : "-", _mark, p->mark, "NAME star_expressions")); } _res = NULL; done: |