Commit b779e54f authored by Robert Bradshaw's avatar Robert Bradshaw

Fix #528, x.conjugate() not available in nogil mode

parent bb0c9225
...@@ -672,7 +672,7 @@ class CNumericType(CType): ...@@ -672,7 +672,7 @@ class CNumericType(CType):
scope.directives = {} scope.directives = {}
entry = scope.declare_cfunction( entry = scope.declare_cfunction(
"conjugate", "conjugate",
CFuncType(self, [CFuncTypeArg("self", self, None)]), CFuncType(self, [CFuncTypeArg("self", self, None)], nogil=True),
pos=None, pos=None,
defining=1, defining=1,
cname=" ") cname=" ")
...@@ -1099,7 +1099,7 @@ class CComplexType(CNumericType): ...@@ -1099,7 +1099,7 @@ class CComplexType(CNumericType):
scope.declare_var("imag", self.real_type, None, "imag", is_cdef=True) scope.declare_var("imag", self.real_type, None, "imag", is_cdef=True)
entry = scope.declare_cfunction( entry = scope.declare_cfunction(
"conjugate", "conjugate",
CFuncType(self, [CFuncTypeArg("self", self, None)]), CFuncType(self, [CFuncTypeArg("self", self, None)], nogil=True),
pos=None, pos=None,
defining=1, defining=1,
cname="__Pyx_c_conj%s" % self.funcsuffix) cname="__Pyx_c_conj%s" % self.funcsuffix)
......
...@@ -162,6 +162,11 @@ def test_conjugate_typedef(cdouble z): ...@@ -162,6 +162,11 @@ def test_conjugate_typedef(cdouble z):
""" """
return z.conjugate() return z.conjugate()
cdef cdouble test_conjugate_nogil(cdouble z) nogil:
# Really just a compile test.
return z.conjugate()
test_conjugate_nogil(0) # use it
## cdef extern from "complex_numbers_T305.h": ## cdef extern from "complex_numbers_T305.h":
## ctypedef double double_really_float "myfloat" ## ctypedef double double_really_float "myfloat"
## ctypedef float float_really_double "mydouble" ## ctypedef float float_really_double "mydouble"
......
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