summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2013-06-24 21:59:24 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2013-06-24 21:59:24 (GMT)
commit7660b880a583442af8ad9d5c91ce608abd4b9654 (patch)
treea239520f616ecf076365a81f3310b02b0808db03 /Objects/tupleobject.c
parent9a644b23cc5ab83fc56ea18dceb4c3b34e653f73 (diff)
downloadcpython-7660b880a583442af8ad9d5c91ce608abd4b9654.zip
cpython-7660b880a583442af8ad9d5c91ce608abd4b9654.tar.gz
cpython-7660b880a583442af8ad9d5c91ce608abd4b9654.tar.bz2
Issue #9566: More long/Py_ssize_t fixes in tuple and list iterators (it_index)
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c4
1 files changed, 2 insertions, 2 deletions
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) {