diff options
author | Gregory Lee <grlee77@gmail.com> | 2021-06-24 11:16:22 -0400 |
---|---|---|
committer | Gregory Lee <grlee77@gmail.com> | 2021-06-24 11:16:22 -0400 |
commit | 3c901b49bd8715c93824c27682d81434d869498a (patch) | |
tree | 867a4fa40aed440518c37265ac7e637a32e40c25 | |
parent | be09bb6ba4d27fbd1f667d34bb2f11cccb446d65 (diff) | |
download | numpy-3c901b49bd8715c93824c27682d81434d869498a.tar.gz |
pass descriptor rather than null
-rw-r--r-- | numpy/core/src/multiarray/convert_datatype.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c index 716e5dd3d..1bba276d2 100644 --- a/numpy/core/src/multiarray/convert_datatype.c +++ b/numpy/core/src/multiarray/convert_datatype.c @@ -417,9 +417,6 @@ PyArray_GetCastSafety( if (to != NULL) { to_dtype = NPY_DTYPE(to); } - if (from == NULL) { - return -1; - } PyObject *meth = PyArray_GetCastingImpl(NPY_DTYPE(from), to_dtype); if (meth == NULL) { return -1; @@ -3297,8 +3294,8 @@ void_to_void_resolve_descriptors( } } - PyArray_Descr *from_base = (from_sub == NULL) ? NULL : from_sub->base; - PyArray_Descr *to_base = (to_sub == NULL) ? NULL : to_sub->base; + PyArray_Descr *from_base = (from_sub == NULL) ? given_descrs[0] : from_sub->base; + PyArray_Descr *to_base = (to_sub == NULL) ? given_descrs[1] : to_sub->base; NPY_CASTING field_casting = PyArray_GetCastSafety(from_base, to_base, NULL); if (field_casting < 0) { return -1; |