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

avoid direct usage of PyComplexObject struct when not building in CPython

--HG--
extra : transplant_source : 8%3D%9FB%EA%E9%08%0A%7B%CB%92%ED%89%ADzL%9Du6%E9
parent 7026837e
......@@ -1942,9 +1942,11 @@ static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject*);
impl="""
static %(type)s __Pyx_PyComplex_As_%(type_name)s(PyObject* o) {
Py_complex cval;
#if CYTHON_COMPILING_IN_CPYTHON
if (PyComplex_CheckExact(o))
cval = ((PyComplexObject *)o)->cval;
else
#endif
cval = PyComplex_AsCComplex(o);
return %(type_name)s_from_parts(
(%(real_type)s)cval.real,
......
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