summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/core/src/multiarray/convert_datatype.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/numpy/core/src/multiarray/convert_datatype.c b/numpy/core/src/multiarray/convert_datatype.c
index 6d164e8bb..54dba55e1 100644
--- a/numpy/core/src/multiarray/convert_datatype.c
+++ b/numpy/core/src/multiarray/convert_datatype.c
@@ -1195,10 +1195,6 @@ PyArray_FindConcatenationDescriptor(
}
}
- if (PyArray_CheckLegacyResultType(&result, n, arrays, 0, NULL) < 0) {
- Py_SETREF(result, NULL); /* Error occurred. */
- }
-
finish:
Py_DECREF(common_dtype);
return result;
@@ -2053,12 +2049,14 @@ PyArray_CheckLegacyResultType(
}
assert(npy_promotion_state == NPY_USE_WEAK_PROMOTION_AND_WARN);
- Py_DECREF(ret);
if (PyErr_WarnFormat(PyExc_UserWarning, 1,
"result dtype changed due to the removal of value-based "
- "promotion from NumPy.") < 0) {
+ "promotion from NumPy. Changed from %S to %S.",
+ ret, *new_result) < 0) {
+ Py_DECREF(ret);
return -1;
}
+ Py_DECREF(ret);
return 0;
}