summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/listobject.c6
-rw-r--r--Objects/tupleobject.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 4cc34b5..0c82cc4 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2660,7 +2660,7 @@ PyTypeObject PyList_Type = {
typedef struct {
PyObject_HEAD
- long it_index;
+ Py_ssize_t it_index;
PyListObject *it_seq; /* Set to NULL when iterator is exhausted */
} listiterobject;
@@ -2797,7 +2797,7 @@ listiter_reduce(listiterobject *it)
static PyObject *
listiter_setstate(listiterobject *it, PyObject *state)
{
- long index = PyLong_AsLong(state);
+ Py_ssize_t index = PyLong_AsSsize_t(state);
if (index == -1 && PyErr_Occurred())
return NULL;
if (it->it_seq != NULL) {
@@ -2958,7 +2958,7 @@ listiter_reduce_general(void *_it, int forward)
if (forward) {
listiterobject *it = (listiterobject *)_it;
if (it->it_seq)
- return Py_BuildValue("N(O)l", _PyObject_GetBuiltin("iter"),
+ return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
} else {
listreviterobject *it = (listreviterobject *)_it;
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index de43ee4..52896b7 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -988,7 +988,7 @@ static PyObject *
tupleiter_reduce(tupleiterobject *it)
{
if (it->it_seq)
- return Py_BuildValue("N(O)l", _PyObject_GetBuiltin("iter"),
+ return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),
it->it_seq, it->it_index);
else
return Py_BuildValue("N(())", _PyObject_GetBuiltin("iter"));
@@ -997,7 +997,7 @@ tupleiter_reduce(tupleiterobject *it)
static PyObject *
tupleiter_setstate(tupleiterobject *it, PyObject *state)
{
- Py_ssize_t index = PyLong_AsLong(state);
+ Py_ssize_t index = PyLong_AsSsize_t(state);
if (index == -1 && PyErr_Occurred())
return NULL;
if (it->it_seq != NULL) {