Closed
Description
Exceptions threw using the Python/C API like PyErr_SetString
should be followed by a return
statement, NumPy follows this almost everywhere, but is the following one I found a carelessness?
(numpy/numpy/core/src/multiarray/methods.c#L736)
if (n == 0) {
if (PyArray_SIZE(self) == 1) {
for (idim = 0; idim < ndim; ++idim) {
multi_index[idim] = 0;
}
}
else {
PyErr_SetString(PyExc_ValueError,
"can only convert an array of size 1 to a Python scalar");
// should have a `return NULL;` here?
}
}
If this is a wrong issue for my limited understanding, please give me some hints, I will appreciate that.
Metadata
Metadata
Assignees
Labels
No labels