Skip to content

Commit 3e4cb2a

Browse files
committed
BUG: Fix missing error return in copyto
Could also just return NULL, but right now the earlier one also uses goto fail, so stick with it. Found in the fast-path PR, it seems there are so many `PyErr_Occurred()` checks, that this didn't really register before.
1 parent e4a495d commit 3e4cb2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

numpy/_core/src/multiarray/multiarraymodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,7 @@ array_copyto(PyObject *NPY_UNUSED(ignored),
19501950
PyErr_Format(PyExc_TypeError,
19511951
"copyto() argument 1 must be a numpy.ndarray, not %s",
19521952
Py_TYPE(dst_obj)->tp_name);
1953+
goto fail;
19531954
}
19541955
PyArrayObject *dst = (PyArrayObject *)dst_obj;
19551956

0 commit comments

Comments
 (0)