Fix normalize arguments when fstring_formatting is disabled (#13910)

This commit is contained in:
Micha Reiser
2024-10-24 15:07:18 +02:00
committed by GitHub
parent 7272f83868
commit 113ce840a6
4 changed files with 12 additions and 12 deletions

View File

@@ -626,7 +626,7 @@ pub(crate) fn normalize_string(
let mut formatted_value_nesting = 0u32;
while let Some((index, c)) = chars.next() {
if matches!(c, '{' | '}') && is_fstring {
if matches!(c, '{' | '}') {
if escape_braces {
// Escape `{` and `}` when converting a regular string literal to an f-string literal.
output.push_str(&input[last_index..=index]);