summaryrefslogtreecommitdiff
path: root/numpy/core/src
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2018-02-25 11:26:17 -0800
committerEric Wieser <wieser.eric@gmail.com>2018-02-25 11:26:17 -0800
commit6d1687cbcdf32a2bde765d39394a7b2bb9838ae4 (patch)
tree164e2c9f200f697a96097f460e324f87a9091ec0 /numpy/core/src
parentd71b17d5aac95ad818dc78680e23f16bdbbf45dd (diff)
downloadnumpy-6d1687cbcdf32a2bde765d39394a7b2bb9838ae4.tar.gz
MAINT: Make the internal np.core.multiarray.[complex_]interp work on 0d arrays
Like other functions, returns a numpy scalar in place of 0d arrays Previously this would throw an exception
Diffstat (limited to 'numpy/core/src')
-rw-r--r--numpy/core/src/multiarray/compiled_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/core/src/multiarray/compiled_base.c b/numpy/core/src/multiarray/compiled_base.c
index 14f4a8f65..12b51156e 100644
--- a/numpy/core/src/multiarray/compiled_base.c
+++ b/numpy/core/src/multiarray/compiled_base.c
@@ -560,7 +560,7 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
if (axp == NULL) {
goto fail;
}
- ax = (PyArrayObject *)PyArray_ContiguousFromAny(x, NPY_DOUBLE, 1, 0);
+ ax = (PyArrayObject *)PyArray_ContiguousFromAny(x, NPY_DOUBLE, 0, 0);
if (ax == NULL) {
goto fail;
}
@@ -671,7 +671,7 @@ arr_interp(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
Py_DECREF(afp);
Py_DECREF(axp);
Py_DECREF(ax);
- return (PyObject *)af;
+ return PyArray_Return(af);
fail:
Py_XDECREF(afp);
@@ -715,7 +715,7 @@ arr_interp_complex(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
if (axp == NULL) {
goto fail;
}
- ax = (PyArrayObject *)PyArray_ContiguousFromAny(x, NPY_DOUBLE, 1, 0);
+ ax = (PyArrayObject *)PyArray_ContiguousFromAny(x, NPY_DOUBLE, 0, 0);
if (ax == NULL) {
goto fail;
}
@@ -847,7 +847,7 @@ arr_interp_complex(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwdict)
Py_DECREF(afp);
Py_DECREF(axp);
Py_DECREF(ax);
- return (PyObject *)af;
+ return PyArray_Return(af);
fail:
Py_XDECREF(afp);