_PyList_Fini() now clears the 'indexerr' error message.
#include "clinic/listobject.c.h"
+static PyObject *indexerr = NULL;
+
#if PyList_MAXFREELIST > 0
static struct _Py_list_state *
get_list_state(void)
struct _Py_list_state *state = &interp->list;
state->numfree = -1;
#endif
+
+ if (_Py_IsMainInterpreter(interp)) {
+ Py_CLEAR(indexerr);
+ }
}
/* Print summary info about the state of the optimized allocator */
return (size_t) i < (size_t) limit;
}
-static PyObject *indexerr = NULL;
-
PyObject *
PyList_GetItem(PyObject *op, Py_ssize_t i)
{