Skip to content

Commit

Permalink
Format strings don't require quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
dflook committed Sep 12, 2024
1 parent e35f880 commit 58d04fd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/python_minifier/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ def visit_JoinedStr(self, node):
self.generic_visit(node)
self.f_string_nesting -= 1

def visit_FormattedValue(self, node):
# Do not visit the format_spec
self.generic_visit(node.value)

def visit_Str(self, node):
self.f_string_nesting += 1
if self.f_string_nesting > 4:
if self.f_string_nesting + 1 > 4:
self.pep701_required = True
self.f_string_nesting -= 1

def visit_Bytes(self, node):
self.f_string_nesting += 1
if self.f_string_nesting > 4:
if self.f_string_nesting + 1 > 4:
self.pep701_required = True
self.f_string_nesting -= 1

# endregion

Expand Down

0 comments on commit 58d04fd

Please sign in to comment.