summaryrefslogtreecommitdiff
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
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 8c00210de1..7efa1a6776 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;
}