summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ParseTreeTransforms.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2017-10-31 11:26:58 +0100
committerStefan Behnel <stefan_ml@behnel.de>2017-10-31 11:26:58 +0100
commitaeeef39da6a9a136c6880974589fa5bdb277e8d6 (patch)
tree18e5763ba3b471d80c6b00a9627ce0f203bc2689 /Cython/Compiler/ParseTreeTransforms.py
parent9c1ef85248ffa89bd470991c5b98dbeb6ca8cb7e (diff)
downloadcython-aeeef39da6a9a136c6880974589fa5bdb277e8d6.tar.gz
Implement line tracing for generators and coroutines.
Closes #1949.
Diffstat (limited to 'Cython/Compiler/ParseTreeTransforms.py')
-rw-r--r--Cython/Compiler/ParseTreeTransforms.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index cfa51e34d..16b38515d 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -1940,6 +1940,8 @@ if VALUE is not None:
binding = self.current_directives.get('binding')
rhs = ExprNodes.PyCFunctionNode.from_defnode(node, binding)
node.code_object = rhs.code_object
+ if node.is_generator:
+ node.gbody.code_object = node.code_object
if env.is_py_class_scope:
rhs.binding = True