diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-09-06 23:40:17 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-06 23:40:17 (GMT) |
commit | bb0dab5c48de0fabec6b3eb27316394e3b65ee2c (patch) | |
tree | 0d85aa6ab4846f9038e572ceb4665d6ddefa15ad /Parser/tokenizer.c | |
parent | a389fdb0958746c4c4ee8849a71a276516f33776 (diff) | |
download | cpython-bb0dab5c48de0fabec6b3eb27316394e3b65ee2c.zip cpython-bb0dab5c48de0fabec6b3eb27316394e3b65ee2c.tar.gz cpython-bb0dab5c48de0fabec6b3eb27316394e3b65ee2c.tar.bz2 |
gh-96611: Fix error message for invalid UTF-8 in mid-multiline string (GH-96623)
(cherry picked from commit 05692c67c51b78a5a5a7bb61d646519025e38015)
Co-authored-by: Michael Droettboom <mdboom@gmail.com>
Diffstat (limited to 'Parser/tokenizer.c')
-rw-r--r-- | Parser/tokenizer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index b61ac12..b5ebcd0 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1945,6 +1945,8 @@ tok_get(struct tok_state *tok, const char **p_start, const char **p_end) /* Get rest of string */ while (end_quote_size != quote_size) { c = tok_nextc(tok); + if (tok->done == E_DECODE) + break; if (c == EOF || (quote_size == 1 && c == '\n')) { assert(tok->multi_line_start != NULL); // shift the tok_state's location into |