Commit 7a787d16 authored by Stefan Behnel's avatar Stefan Behnel

do not generate dead code at the end of the generator instantiation function

parent bef06c19
...@@ -3853,10 +3853,10 @@ class GeneratorDefNode(DefNode): ...@@ -3853,10 +3853,10 @@ class GeneratorDefNode(DefNode):
child_attrs = DefNode.child_attrs + ["gbody"] child_attrs = DefNode.child_attrs + ["gbody"]
def __init__(self, **kwargs): def __init__(self, pos, **kwargs):
# XXX: don't actually needs a body # XXX: don't actually needs a body
kwargs['body'] = StatListNode(kwargs['pos'], stats=[]) kwargs['body'] = StatListNode(pos, stats=[], is_terminator=True)
super(GeneratorDefNode, self).__init__(**kwargs) super(GeneratorDefNode, self).__init__(pos, **kwargs)
def analyse_declarations(self, env): def analyse_declarations(self, env):
super(GeneratorDefNode, self).analyse_declarations(env) super(GeneratorDefNode, self).analyse_declarations(env)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment