mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 05:51:03 -05:00
Hug closing } when f-string expression has a format specifier (#18704)
This commit is contained in:
@@ -50,7 +50,7 @@ impl<'a, 'src> StringNormalizer<'a, 'src> {
|
||||
if let InterpolatedStringState::InsideInterpolatedElement(parent_context) =
|
||||
self.context.interpolated_string_state()
|
||||
{
|
||||
let parent_flags = parent_context.interpolated_string().flags();
|
||||
let parent_flags = parent_context.flags();
|
||||
if !parent_flags.is_triple_quoted() || string.flags().is_triple_quoted() {
|
||||
// This logic is even necessary when using preserve and the target python version doesn't support PEP701 because
|
||||
// we might end up joining two f-strings that have different quote styles, in which case we need to alternate the quotes
|
||||
|
||||
Reference in New Issue
Block a user