diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2023-10-02 14:54:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-02 14:54:16 (GMT) |
commit | 9207c870bec173dafd3f2e6c811482c782db034f (patch) | |
tree | d48539f49805eb013b291202fdda954d6ac779cc /Parser | |
parent | a4f186ad4934aad30ea2f54d9f88726e60db1250 (diff) | |
download | cpython-9207c870bec173dafd3f2e6c811482c782db034f.zip cpython-9207c870bec173dafd3f2e6c811482c782db034f.tar.gz cpython-9207c870bec173dafd3f2e6c811482c782db034f.tar.bz2 |
[3.12] gh-88943: Improve syntax error for non-ASCII character that follows a numerical literal (GH-109081) (#109090)
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.
(cherry picked from commit b2729e93e9d73503b1fda4ea4fecd77c58909091)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Diffstat (limited to 'Parser')
-rw-r--r-- | Parser/tokenizer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index c4c345e..9911fa5 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1648,7 +1648,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; |