summaryrefslogtreecommitdiff
path: root/numpy/core/src/arraymethods.c
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/core/src/arraymethods.c')
-rw-r--r--numpy/core/src/arraymethods.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/numpy/core/src/arraymethods.c b/numpy/core/src/arraymethods.c
index a693f42ef..fa7177b16 100644
--- a/numpy/core/src/arraymethods.c
+++ b/numpy/core/src/arraymethods.c
@@ -530,6 +530,9 @@ array_cast(PyArrayObject *self, PyObject *args)
Py_XDECREF(descr);
return obj;
}
+ if (descr->names != NULL) {
+ return PyArray_FromArray(self, descr, 0);
+ }
return _ARET(PyArray_CastToType(self, descr, 0));
}