From 32009775e569491a6a535c6e48201a3409e036f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Langa?= Date: Mon, 28 Oct 2019 19:39:48 +0100 Subject: [PATCH] Restore simple form of if statement --- black.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/black.py b/black.py index f0e83f8..d837c89 100644 --- a/black.py +++ b/black.py @@ -2950,7 +2950,6 @@ def normalize_invisible_parens(node: Node, parens_after: Set[str]) -> None: if pc.value in FMT_OFF: # This `node` has a prefix with `# fmt: off`, don't mess with parens. return - check_lpar = False for index, child in enumerate(list(node.children)): # Add parentheses around long tuple unpacking in assignments. @@ -2966,15 +2965,7 @@ def normalize_invisible_parens(node: Node, parens_after: Set[str]) -> None: continue if child.type == syms.atom: - # Determines if the underlying atom should be surrounded with - # 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: + if maybe_make_parens_invisible_in_atom(child, parent=node): lpar = Leaf(token.LPAR, "") rpar = Leaf(token.RPAR, "") index = child.remove() or 0 -- 2.39.5