mirror of
https://github.com/python/cpython.git
synced 2026-01-03 14:02:21 +00:00
Issue #19437: Fix Array_subscript() of ctypes, handle Array_item() failure
This commit is contained in:
parent
db816d6546
commit
6decccdafe
1 changed files with 4 additions and 0 deletions
|
|
@ -4280,6 +4280,10 @@ Array_subscript(PyObject *myself, PyObject *item)
|
|||
for (cur = start, i = 0; i < slicelen;
|
||||
cur += step, i++) {
|
||||
PyObject *v = Array_item(myself, cur);
|
||||
if (v == NULL) {
|
||||
Py_DECREF(np);
|
||||
return NULL;
|
||||
}
|
||||
PyList_SET_ITEM(np, i, v);
|
||||
}
|
||||
return np;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue