# HG changeset patch # User Paul Boddie # Date 1385674036 -3600 # Node ID f72b2becdfde43baf9d55faca1dfbe2fbbbc57f3 # Parent c75cba99b508c907f2e3d76b881eecb444900318 Produce a "pass" statement where compound statements are empty. diff -r c75cba99b508 -r f72b2becdfde compiler/ast.py --- a/compiler/ast.py Sun Nov 17 00:24:20 2013 +0100 +++ b/compiler/ast.py Thu Nov 28 22:27:16 2013 +0100 @@ -1887,7 +1887,8 @@ return "Stmt(%r)" % (self.nodes,) def __str__(self): - return "\n".join(map(str, flatten_statement(self.nodes))) + nodes = flatten_statement(self.nodes) + return "\n".join(map(str, nodes or [Pass()])) def visit(self, visitor, *args): return visitor.visitStmt(self, *args)