mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
Issue #19437: Fix Array_subscript() of ctypes, handle Array_item() failure
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user