Commit 9e6b2df5 authored by Stefan Behnel's avatar Stefan Behnel

Make `cpdef func() nogil` work with CyFunctions by excluding the Python...

Make `cpdef func() nogil` work with CyFunctions by excluding the Python function creation from the 'nogil' check.
parent b1704d61
...@@ -2295,7 +2295,7 @@ class CFuncDefNode(FuncDefNode): ...@@ -2295,7 +2295,7 @@ class CFuncDefNode(FuncDefNode):
# is_c_class_method whether this is a cclass method # is_c_class_method whether this is a cclass method
child_attrs = ["base_type", "declarator", "body", "py_func_stat", "decorators"] child_attrs = ["base_type", "declarator", "body", "py_func_stat", "decorators"]
outer_attrs = ["decorators"] outer_attrs = ["decorators", "py_func_stat"]
inline_in_pxd = False inline_in_pxd = False
decorators = None decorators = None
......
# cython: binding=True
# mode: run
# tag: cyfunction
cpdef int simple() nogil:
"""
>>> simple()
1
"""
return 1
cpdef int call_nogil():
"""
>>> call_nogil()
1
"""
with nogil:
return simple()
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