diff options
author | Marion <marion.zepf@gmail.com> | 2013-09-06 09:31:51 (GMT) |
---|---|---|
committer | Marion <marion.zepf@gmail.com> | 2013-09-06 09:31:51 (GMT) |
commit | a6541270404dfac233ce73c3b9976a7659583eb2 (patch) | |
tree | 045e0bfa44824a7582d564654dcd1afc92f8746f | |
parent | 7fd1b3501da17b96198d4d7cac5208c6dacd478d (diff) |
fix util.codegen: allow 'return' statements without a return value
-rw-r--r-- | util/codegen.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/util/codegen.py b/util/codegen.py index 43e9707..5f768f8 100644 --- a/util/codegen.py +++ b/util/codegen.py @@ -328,7 +328,8 @@ class SourceGenerator(NodeVisitor): def visit_Return(self, node): self.newline(node) self.write('return ') - self.visit(node.value) + if hasattr(node, "value") and node.value is not None: + self.visit(node.value) def visit_Break(self, node): self.newline(node) |