summaryrefslogtreecommitdiff
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index 8c00210de1..7920fec2bd 100644
--- a/Objects/tupleobject.c
+++ b/Objects/tupleobject.c
@@ -97,7 +97,7 @@ PyTuple_New(Py_ssize_t size)
#endif
{
/* Check for overflow */
- if (size > (PY_SSIZE_T_MAX - sizeof(PyTupleObject) -
+ if ((size_t)size > ((size_t)PY_SSIZE_T_MAX - sizeof(PyTupleObject) -
sizeof(PyObject *)) / sizeof(PyObject *)) {
return PyErr_NoMemory();
}
@@ -746,7 +746,7 @@ tuplesubscript(PyTupleObject* self, PyObject* item)
}
else {
PyErr_Format(PyExc_TypeError,
- "tuple indices must be integers, not %.200s",
+ "tuple indices must be integers or slices, not %.200s",
Py_TYPE(item)->tp_name);
return NULL;
}
@@ -964,8 +964,8 @@ tupleiter_next(tupleiterobject *it)
return item;
}
- Py_DECREF(seq);
it->it_seq = NULL;
+ Py_DECREF(seq);
return NULL;
}