mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081)
It now points on the invalid non-ASCII character, not on the valid numerical literal.
This commit is contained in:
parent
ac31f714c3
commit
b2729e93e9
3 changed files with 8 additions and 1 deletions
|
@ -1642,7 +1642,7 @@ verify_end_of_number(struct tok_state *tok, int c, const char *kind) {
|
|||
tok_nextc(tok);
|
||||
}
|
||||
else /* In future releases, only error will remain. */
|
||||
if (is_potential_identifier_char(c)) {
|
||||
if (c < 128 && is_potential_identifier_char(c)) {
|
||||
tok_backup(tok, c);
|
||||
syntaxerror(tok, "invalid %s literal", kind);
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue