From 4736a570e626d1a3e7feeac258345f15ea997ac4 Mon Sep 17 00:00:00 2001 From: guillaume Date: Fri, 2 Mar 2012 04:37:41 +0100 Subject: [PATCH] Fixed bug in assert statement --- pyc2py.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyc2py.py b/pyc2py.py index 488c743..4a7ca2a 100755 --- a/pyc2py.py +++ b/pyc2py.py @@ -106,7 +106,7 @@ def delete_statements(self, match, rec = False): def write(self, indent = ''): self.replace_statements( match = lambda s: isinstance(s, If) and len(s.statements) == 1 and isinstance(s.statements[0], Raise) and s.statements[0].exception == Variable('AssertionError'), - new = lambda s: Assert(s.expr if isinstance(s.expr, UnaryOp) and s.expr.op == 'not ' else UnaryOp('not ', s.expr), s.statements[0].param) + new = lambda s: Assert(s.expr.expr if isinstance(s.expr, UnaryOp) and s.expr.op == 'not ' else UnaryOp('not ', s.expr), s.statements[0].param) ) if len(self.statements) == 0: self.append_statement(Pass())