diff --git a/Lib/compiler/pycodegen.py b/Lib/compiler/pycodegen.py index bfb50597b9a..0097482447c 100644 --- a/Lib/compiler/pycodegen.py +++ b/Lib/compiler/pycodegen.py @@ -909,6 +909,11 @@ def visitReturn(self, node): self.visit(node.value) self.emit('RETURN_VALUE') + def visitYield(self, node): + self.set_lineno(node) + self.visit(node.value) + self.emit('YIELD_STMT') + # slice and subscript stuff def visitSlice(self, node, aug_flag=None): diff --git a/Tools/compiler/compiler/pycodegen.py b/Tools/compiler/compiler/pycodegen.py index bfb50597b9a..0097482447c 100644 --- a/Tools/compiler/compiler/pycodegen.py +++ b/Tools/compiler/compiler/pycodegen.py @@ -909,6 +909,11 @@ def visitReturn(self, node): self.visit(node.value) self.emit('RETURN_VALUE') + def visitYield(self, node): + self.set_lineno(node) + self.visit(node.value) + self.emit('YIELD_STMT') + # slice and subscript stuff def visitSlice(self, node, aug_flag=None):