From: Robert Bradshaw Date: Fri, 16 Jul 2010 07:23:48 +0000 (-0700) Subject: Disable closures inside cdef functions for now. X-Git-Tag: 0.13.beta0~2^2~14 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=fda65d47dbe1ca6af714d467ebac7888947a568d;p=cython.git Disable closures inside cdef functions for now. --- diff --git a/Cython/Compiler/DebugFlags.py b/Cython/Compiler/DebugFlags.py index d6d52189..19aa3ca2 100644 --- a/Cython/Compiler/DebugFlags.py +++ b/Cython/Compiler/DebugFlags.py @@ -7,7 +7,7 @@ debug_coercion = 0 debug_temp_code_comments = 0 # Write a call trace of the code generation phase into the C code -debug_trace_code_generation = 0 +debug_trace_code_generation = 1 # Do not replace exceptions with user-friendly error messages debug_no_exception_intercept = 0 diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index 161de9d0..64c29a0c 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -1224,6 +1224,12 @@ class MarkClosureVisitor(CythonTransform): node.needs_closure = self.needs_closure self.needs_closure = True return node + + def visit_CFuncDefNode(self, node): + self.visit_FuncDefNode(node) + if node.needs_closure: + error(node.pos, "closures inside cdef functions not yet supported") + return node def visit_LambdaNode(self, node): self.needs_closure = False