summaryrefslogtreecommitdiffstats
path: root/Parser
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2023-09-07 14:00:13 (GMT)
committerGitHub <noreply@github.com>2023-09-07 14:00:13 (GMT)
commitb2729e93e9d73503b1fda4ea4fecd77c58909091 (patch)
tree1dbd2482d926c33423c48fde3a2e3505cbb5c5a6 /Parser
parentac31f714c3e55a7951a9f3f9c823740c20c5d595 (diff)
downloadcpython-b2729e93e9d73503b1fda4ea4fecd77c58909091.zip
cpython-b2729e93e9d73503b1fda4ea4fecd77c58909091.tar.gz
cpython-b2729e93e9d73503b1fda4ea4fecd77c58909091.tar.bz2
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.
Diffstat (limited to 'Parser')
-rw-r--r--Parser/tokenizer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c
index 6ec2489..46b7159 100644
--- a/Parser/tokenizer.c
+++ b/Parser/tokenizer.c
@@ -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;