Restore simple form of if statement
This commit is contained in:
parent
c1fe3aa4f8
commit
32009775e5
11
black.py
11
black.py
@ -2950,7 +2950,6 @@ def normalize_invisible_parens(node: Node, parens_after: Set[str]) -> None:
|
|||||||
if pc.value in FMT_OFF:
|
if pc.value in FMT_OFF:
|
||||||
# This `node` has a prefix with `# fmt: off`, don't mess with parens.
|
# This `node` has a prefix with `# fmt: off`, don't mess with parens.
|
||||||
return
|
return
|
||||||
|
|
||||||
check_lpar = False
|
check_lpar = False
|
||||||
for index, child in enumerate(list(node.children)):
|
for index, child in enumerate(list(node.children)):
|
||||||
# Add parentheses around long tuple unpacking in assignments.
|
# Add parentheses around long tuple unpacking in assignments.
|
||||||
@ -2966,15 +2965,7 @@ def normalize_invisible_parens(node: Node, parens_after: Set[str]) -> None:
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if child.type == syms.atom:
|
if child.type == syms.atom:
|
||||||
# Determines if the underlying atom should be surrounded with
|
if maybe_make_parens_invisible_in_atom(child, parent=node):
|
||||||
# invisible params - also makes parens invisible recursively
|
|
||||||
# within the atom and removes repeated invisible parens within
|
|
||||||
# the atom
|
|
||||||
should_surround_with_parens = maybe_make_parens_invisible_in_atom(
|
|
||||||
child, parent=node
|
|
||||||
)
|
|
||||||
|
|
||||||
if should_surround_with_parens:
|
|
||||||
lpar = Leaf(token.LPAR, "")
|
lpar = Leaf(token.LPAR, "")
|
||||||
rpar = Leaf(token.RPAR, "")
|
rpar = Leaf(token.RPAR, "")
|
||||||
index = child.remove() or 0
|
index = child.remove() or 0
|
||||||
|
Loading…
Reference in New Issue
Block a user