diff options
author | Lysandros Nikolaou <lisandrosnik@gmail.com> | 2025-04-30 11:46:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-30 11:46:41 +0200 |
commit | 60202609a2c2d0971aadfa4729ba30b50e89c6ea (patch) | |
tree | d821f3f8f277de56e5d8da457d492f1288cb2bb9 /Parser/string_parser.c | |
parent | 5ea9010e8910cb97555c3aef4ed95cca93a74aab (diff) | |
download | cpython-60202609a2c2d0971aadfa4729ba30b50e89c6ea.tar.gz cpython-60202609a2c2d0971aadfa4729ba30b50e89c6ea.zip |
gh-132661: Implement PEP 750 (#132662)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wingy <git@wingysam.xyz>
Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Dave Peck <davepeck@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Paul Everitt <pauleveritt@me.com>
Co-authored-by: sobolevn <mail@sobolevn.me>
Diffstat (limited to 'Parser/string_parser.c')
-rw-r--r-- | Parser/string_parser.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Parser/string_parser.c b/Parser/string_parser.c index 9b557e94d00..d3631b114c5 100644 --- a/Parser/string_parser.c +++ b/Parser/string_parser.c @@ -19,7 +19,8 @@ warn_invalid_escape_sequence(Parser *p, const char* buffer, const char *first_in return 0; } unsigned char c = (unsigned char)*first_invalid_escape; - if ((t->type == FSTRING_MIDDLE || t->type == FSTRING_END) && (c == '{' || c == '}')) { + if ((t->type == FSTRING_MIDDLE || t->type == FSTRING_END || t->type == TSTRING_MIDDLE || t->type == TSTRING_END) + && (c == '{' || c == '}')) { // in this case the tokenizer has already emitted a warning, // see Parser/tokenizer/helpers.c:warn_invalid_escape_sequence return 0; |