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