diff options
-rw-r--r-- | numpy/core/src/multiarray/dtype_transfer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/numpy/core/src/multiarray/dtype_transfer.c b/numpy/core/src/multiarray/dtype_transfer.c index 7a7379ad5..f11ea395f 100644 --- a/numpy/core/src/multiarray/dtype_transfer.c +++ b/numpy/core/src/multiarray/dtype_transfer.c @@ -1362,6 +1362,13 @@ get_nbo_cast_transfer_function(int aligned, break; } + if (PyDataType_FLAGCHK(src_dtype, NPY_NEEDS_PYAPI) || + PyDataType_FLAGCHK(dst_dtype, NPY_NEEDS_PYAPI)) { + if (out_needs_api) { + *out_needs_api = 1; + } + } + /* Get the cast function */ castfunc = PyArray_GetCastFunc(src_dtype, dst_dtype->type_num); if (!castfunc) { |