File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2660,7 +2660,7 @@ PyTypeObject PyList_Type = {
26602660
26612661typedef struct {
26622662 PyObject_HEAD
2663- long it_index ;
2663+ Py_ssize_t it_index ;
26642664 PyListObject * it_seq ; /* Set to NULL when iterator is exhausted */
26652665} listiterobject ;
26662666
@@ -2797,7 +2797,7 @@ listiter_reduce(listiterobject *it)
27972797static PyObject *
27982798listiter_setstate (listiterobject * it , PyObject * state )
27992799{
2800- long index = PyLong_AsLong (state );
2800+ Py_ssize_t index = PyLong_AsSsize_t (state );
28012801 if (index == -1 && PyErr_Occurred ())
28022802 return NULL ;
28032803 if (it -> it_seq != NULL ) {
@@ -2958,7 +2958,7 @@ listiter_reduce_general(void *_it, int forward)
29582958 if (forward ) {
29592959 listiterobject * it = (listiterobject * )_it ;
29602960 if (it -> it_seq )
2961- return Py_BuildValue ("N(O)l " , _PyObject_GetBuiltin ("iter" ),
2961+ return Py_BuildValue ("N(O)n " , _PyObject_GetBuiltin ("iter" ),
29622962 it -> it_seq , it -> it_index );
29632963 } else {
29642964 listreviterobject * it = (listreviterobject * )_it ;
Original file line number Diff line number Diff line change @@ -988,7 +988,7 @@ static PyObject *
988988tupleiter_reduce (tupleiterobject * it )
989989{
990990 if (it -> it_seq )
991- return Py_BuildValue ("N(O)l " , _PyObject_GetBuiltin ("iter" ),
991+ return Py_BuildValue ("N(O)n " , _PyObject_GetBuiltin ("iter" ),
992992 it -> it_seq , it -> it_index );
993993 else
994994 return Py_BuildValue ("N(())" , _PyObject_GetBuiltin ("iter" ));
@@ -997,7 +997,7 @@ tupleiter_reduce(tupleiterobject *it)
997997static PyObject *
998998tupleiter_setstate (tupleiterobject * it , PyObject * state )
999999{
1000- Py_ssize_t index = PyLong_AsLong (state );
1000+ Py_ssize_t index = PyLong_AsSsize_t (state );
10011001 if (index == -1 && PyErr_Occurred ())
10021002 return NULL ;
10031003 if (it -> it_seq != NULL ) {
You can’t perform that action at this time.
0 commit comments