diff options
-rw-r--r-- | numpy/core/src/multiarray/convert_datatype.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index 557bb913b..c19fe8e23 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -1076,7 +1076,7 @@ PyArray_PromoteTypes(PyArray_Descr *type1, PyArray_Descr *type2) /* Fast path for identical inputs (NOTE: This path preserves metadata!) */ if (type1 == type2 /* Use for builtin except void, void has no reliable byteorder */ - && type1->type_num > 0 && type1->type_num < NPY_NTYPES + && type1->type_num >= 0 && type1->type_num < NPY_NTYPES && PyArray_ISNBO(type1->byteorder) && type1->type_num != NPY_VOID) { Py_INCREF(type1); return type1; |