summaryrefslogtreecommitdiff
path: root/numpy/core/src/umath/ufunc_type_resolution.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:38:55 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2020-12-31 09:38:55 +0900
commit92fba4b9b454bc82b27770074a248dd685053832 (patch)
tree6ee53dfa05d52fbd824da6abc7d190485505f646 /numpy/core/src/umath/ufunc_type_resolution.c
parent295fa02e974b890f98bb7bf6a94045c2cd3f5f68 (diff)
downloadpython-numpy-92fba4b9b454bc82b27770074a248dd685053832.tar.gz
python-numpy-92fba4b9b454bc82b27770074a248dd685053832.tar.bz2
python-numpy-92fba4b9b454bc82b27770074a248dd685053832.zip
Imported Upstream version 1.18.0upstream/1.18.0
Diffstat (limited to 'numpy/core/src/umath/ufunc_type_resolution.c')
-rw-r--r--numpy/core/src/umath/ufunc_type_resolution.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/numpy/core/src/umath/ufunc_type_resolution.c b/numpy/core/src/umath/ufunc_type_resolution.c
index 25dd002ac..f93d8229e 100644
--- a/numpy/core/src/umath/ufunc_type_resolution.c
+++ b/numpy/core/src/umath/ufunc_type_resolution.c
@@ -548,6 +548,7 @@ PyUFunc_SimpleUniformOperationTypeResolver(
}
out_dtypes[0] = ensure_dtype_nbo(dtype);
+ Py_DECREF(dtype);
if (out_dtypes[0] == NULL) {
return -1;
}
@@ -882,7 +883,7 @@ PyUFunc_SubtractionTypeResolver(PyUFuncObject *ufunc,
/* The type resolver would have upcast already */
if (out_dtypes[0]->type_num == NPY_BOOL) {
PyErr_Format(PyExc_TypeError,
- "numpy boolean subtract, the `-` operator, is deprecated, "
+ "numpy boolean subtract, the `-` operator, is not supported, "
"use the bitwise_xor, the `^` operator, or the logical_xor "
"function instead.");
return -1;
@@ -1957,7 +1958,8 @@ linear_search_type_resolver(PyUFuncObject *self,
npy_intp i, j, nin = self->nin, nop = nin + self->nout;
int types[NPY_MAXARGS];
const char *ufunc_name;
- int no_castable_output, use_min_scalar;
+ int no_castable_output = 0;
+ int use_min_scalar;
/* For making a better error message on coercion error */
char err_dst_typecode = '-', err_src_typecode = '-';
@@ -2264,7 +2266,6 @@ PyUFunc_DivmodTypeResolver(PyUFuncObject *ufunc,
out_dtypes[1] = out_dtypes[0];
Py_INCREF(out_dtypes[1]);
out_dtypes[2] = PyArray_DescrFromType(NPY_LONGLONG);
- Py_INCREF(out_dtypes[2]);
out_dtypes[3] = out_dtypes[0];
Py_INCREF(out_dtypes[3]);
}