Commit c66708bd authored by Stefan Behnel's avatar Stefan Behnel

make auto_cpdef play nicely with closure functions

parent 920ddf72
......@@ -135,8 +135,8 @@ class Context(object):
PostParse(self),
_specific_post_parse,
InterpretCompilerDirectives(self, self.compiler_directives),
_align_function_definitions,
MarkClosureVisitor(self),
_align_function_definitions,
ConstantFolding(),
FlattenInListTransform(),
WithTransform(self),
......
......@@ -1425,9 +1425,11 @@ class AlignFunctionDefinitions(CythonTransform):
error(pxd_def.pos, "previous declaration here")
return None
node = node.as_cfunction(pxd_def)
elif self.scope.is_module_scope and self.directives['auto_cpdef']:
elif (self.scope.is_module_scope
and not node.needs_closure
and self.directives['auto_cpdef']):
node = node.as_cfunction(scope=self.scope)
# Enable this when internal def functions are allowed.
# Enable this when nested cdef functions are allowed.
# self.visitchildren(node)
return node
......
......@@ -19,7 +19,6 @@ for_from_pyvar_loop_T601
decorators_T593
temp_sideeffects_T654
class_scope_T671
auto_cpdef_closures
# CPython regression tests that don't current work:
pyregr.test_threadsignals
......
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