diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/core/src/umath/reduction.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/numpy/core/src/umath/reduction.c b/numpy/core/src/umath/reduction.c index 79c302755..5b049be4e 100644 --- a/numpy/core/src/umath/reduction.c +++ b/numpy/core/src/umath/reduction.c @@ -18,6 +18,7 @@ #include "npy_config.h" #include "npy_pycompat.h" +#include "ctors.h" #include "numpy/ufuncobject.h" #include "lowlevel_strided_loops.h" @@ -174,23 +175,14 @@ conform_reduce_result(PyArrayObject *in, const npy_bool *axis_flags, dtype = PyArray_DESCR(out); Py_INCREF(dtype); - /* TODO: use PyArray_NewFromDescrAndBase here once multiarray and umath - * are merged - */ - ret = (PyArrayObject_fields *)PyArray_NewFromDescr( + ret = (PyArrayObject_fields *)PyArray_NewFromDescrAndBase( &PyArray_Type, dtype, ndim, shape, strides, PyArray_DATA(out), - PyArray_FLAGS(out), NULL); + PyArray_FLAGS(out), NULL, (PyObject *)out); if (ret == NULL) { return NULL; } - Py_INCREF(out); - if (PyArray_SetBaseObject((PyArrayObject *)ret, (PyObject *)out) < 0) { - Py_DECREF(ret); - return NULL; - } - if (need_copy) { PyArrayObject *ret_copy; |