Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
MNT: delete unnecessary decrefs (covered by goto fail logic)
  • Loading branch information
ngoldbaum committed Apr 16, 2024
commit 26f74212c47eccced0f3fe1fef16e76e02f5c03b
3 changes: 0 additions & 3 deletions numpy/_core/src/multiarray/ctors.c
Original file line number Diff line number Diff line change
Expand Up @@ -2394,22 +2394,19 @@ PyArray_FromInterface(PyObject *origin)
PyErr_SetString(PyExc_TypeError,
"strides must be a tuple");
Py_DECREF(ret);
Py_DECREF(attr);
goto fail;
}
if (n != PyTuple_GET_SIZE(attr)) {
PyErr_SetString(PyExc_ValueError,
"mismatch in length of strides and shape");
Py_DECREF(ret);
Py_DECREF(attr);
goto fail;
}
for (i = 0; i < n; i++) {
PyObject *tmp = PyTuple_GET_ITEM(attr, i);
strides[i] = PyArray_PyIntAsIntp(tmp);
if (error_converting(strides[i])) {
Py_DECREF(ret);
Py_DECREF(attr);
goto fail;
}
}
Expand Down