@@ -573,11 +573,11 @@ def _write_str_avoiding_backslashes(self, string, *, quote_types=_ALL_QUOTES):
573573 quote_type = quote_types [0 ]
574574 self .write (f"{ quote_type } { string } { quote_type } " )
575575
576- def _ftstring_helper (self , ftstring_parts ):
577- new_ftstring_parts = []
576+ def _ftstring_helper (self , parts ):
577+ new_parts = []
578578 quote_types = list (_ALL_QUOTES )
579579 fallback_to_repr = False
580- for value , is_constant in ftstring_parts :
580+ for value , is_constant in parts :
581581 if is_constant :
582582 value , new_quote_types = self ._str_literal_helper (
583583 value ,
@@ -596,22 +596,22 @@ def _ftstring_helper(self, ftstring_parts):
596596 new_quote_types = [q for q in quote_types if q not in value ]
597597 if new_quote_types :
598598 quote_types = new_quote_types
599- new_ftstring_parts .append (value )
599+ new_parts .append (value )
600600
601601 if fallback_to_repr :
602602 # If we weren't able to find a quote type that works for all parts
603603 # of the JoinedStr, fallback to using repr and triple single quotes.
604604 quote_types = ["'''" ]
605- new_ftstring_parts .clear ()
606- for value , is_constant in ftstring_parts :
605+ new_parts .clear ()
606+ for value , is_constant in parts :
607607 if is_constant :
608608 value = repr ('"' + value ) # force repr to use single quotes
609609 expected_prefix = "'\" "
610610 assert value .startswith (expected_prefix ), repr (value )
611611 value = value [len (expected_prefix ):- 1 ]
612- new_ftstring_parts .append (value )
612+ new_parts .append (value )
613613
614- value = "" .join (new_ftstring_parts )
614+ value = "" .join (new_parts )
615615 quote_type = quote_types [0 ]
616616 self .write (f"{ quote_type } { value } { quote_type } " )
617617
0 commit comments