From 6533e83af09de7345d1b438512679992f080dcc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=20van=20Merri=C3=ABnboer?= Date: Wed, 8 Aug 2018 15:12:12 -0400 Subject: [PATCH] Fix swapping of branches (#83) --- tangent/transformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tangent/transformers.py b/tangent/transformers.py index 3d6e27f..51f3e99 100644 --- a/tangent/transformers.py +++ b/tangent/transformers.py @@ -272,7 +272,7 @@ def visit(self, node): if not node.orelse: return else: - node.test = gast.UnaryOp(op=gast.Not, operand=node.test) + node.test = gast.UnaryOp(op=gast.Not(), operand=node.test) node.body, node.orelse = node.orelse, node.body elif isinstance(node, (gast.While, gast.For)) and not node.body: return node.orelse