@@ -4277,11 +4277,10 @@ Array_subscript(PyObject *myself, PyObject *item)
42774277 PyObject * np ;
42784278 Py_ssize_t start , stop , step , slicelen , cur , i ;
42794279
4280- if (PySlice_GetIndicesEx (item ,
4281- self -> b_length , & start , & stop ,
4282- & step , & slicelen ) < 0 ) {
4280+ if (PySlice_Unpack (item , & start , & stop , & step ) < 0 ) {
42834281 return NULL ;
42844282 }
4283+ slicelen = PySlice_AdjustIndices (self -> b_length , & start , & stop , step );
42854284
42864285 stgdict = PyObject_stgdict ((PyObject * )self );
42874286 assert (stgdict ); /* Cannot be NULL for array object instances */
@@ -4418,11 +4417,10 @@ Array_ass_subscript(PyObject *myself, PyObject *item, PyObject *value)
44184417 else if (PySlice_Check (item )) {
44194418 Py_ssize_t start , stop , step , slicelen , otherlen , i , cur ;
44204419
4421- if (PySlice_GetIndicesEx (item ,
4422- self -> b_length , & start , & stop ,
4423- & step , & slicelen ) < 0 ) {
4420+ if (PySlice_Unpack (item , & start , & stop , & step ) < 0 ) {
44244421 return -1 ;
44254422 }
4423+ slicelen = PySlice_AdjustIndices (self -> b_length , & start , & stop , step );
44264424 if ((step < 0 && start < stop ) ||
44274425 (step > 0 && start > stop ))
44284426 stop = start ;
0 commit comments