summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
Diffstat (limited to 'numpy')
-rw-r--r--numpy/core/src/multiarray/arrayobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/arrayobject.c b/numpy/core/src/multiarray/arrayobject.c
index 0b59c6b59..03760d3fa 100644
--- a/numpy/core/src/multiarray/arrayobject.c
+++ b/numpy/core/src/multiarray/arrayobject.c
@@ -859,7 +859,7 @@ _void_compare(PyArrayObject *self, PyArrayObject *other, int cmp_op)
* dimensions will have been appended to `a` and `b`.
* In that case, reduce them using `op`.
*/
- if (PyArray_NDIM(temp) > result_ndim) {
+ if (PyArray_Check(temp) && PyArray_NDIM(temp) > result_ndim) {
/* If the type was multidimensional, collapse that part to 1-D
*/
if (PyArray_NDIM(temp) != result_ndim+1) {