mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
gh-113703: Correctly identify incomplete f-strings in the codeop module (#113709)
This commit is contained in:
parent
0ae60b66de
commit
3003fbbf00
3 changed files with 11 additions and 2 deletions
|
|
@ -1355,9 +1355,13 @@ tok_get_fstring_mode(struct tok_state *tok, tokenizer_mode* current_tok, struct
|
|||
tok->lineno = the_current_tok->f_string_line_start;
|
||||
|
||||
if (current_tok->f_string_quote_size == 3) {
|
||||
return MAKE_TOKEN(_PyTokenizer_syntaxerror(tok,
|
||||
_PyTokenizer_syntaxerror(tok,
|
||||
"unterminated triple-quoted f-string literal"
|
||||
" (detected at line %d)", start));
|
||||
" (detected at line %d)", start);
|
||||
if (c != '\n') {
|
||||
tok->done = E_EOFS;
|
||||
}
|
||||
return MAKE_TOKEN(ERRORTOKEN);
|
||||
}
|
||||
else {
|
||||
return MAKE_TOKEN(_PyTokenizer_syntaxerror(tok,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue