diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index dcb66cf0a89..f730915151a 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -447,10 +447,7 @@ getarrayitem(PyObject *op, int i) register arrayobject *ap; assert(array_Check(op)); ap = (arrayobject *)op; - if (i < 0 || i >= ap->ob_size) { - PyErr_SetString(PyExc_IndexError, "array index out of range"); - return NULL; - } + assert(i>=0 && iob_size); return (*ap->ob_descr->getitem)(ap, i); }