summaryrefslogtreecommitdiffstats
path: root/Objects/listobject.c
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2014-08-02 05:30:37 (GMT)
committerTerry Jan Reedy <tjreedy@udel.edu>2014-08-02 05:30:37 (GMT)
commitffff1440d118cae189a6c2baf595dda52cdc7c3a (patch)
treee1664353a0276044933c16879fa59e7521a6044e /Objects/listobject.c
parent7f9cc9359bdbcc877b2a6f976c8e8bdbc714ce90 (diff)
downloadcpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.zip
cpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.tar.gz
cpython-ffff1440d118cae189a6c2baf595dda52cdc7c3a.tar.bz2
Issue #22077: Improve index error messages for bytearrays, bytes, lists, and
tuples by adding 'or slices'. Added ', not <typename' for bytearrays. Original patch by Claudiu Popa.
Diffstat (limited to 'Objects/listobject.c')
-rw-r--r--Objects/listobject.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index fd5a72a..e7c4c82 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2444,7 +2444,7 @@ list_subscript(PyListObject* self, PyObject* item)
}
else {
PyErr_Format(PyExc_TypeError,
- "list indices must be integers, not %.200s",
+ "list indices must be integers or slices, not %.200s",
item->ob_type->tp_name);
return NULL;
}
@@ -2608,7 +2608,7 @@ list_ass_subscript(PyListObject* self, PyObject* item, PyObject* value)
}
else {
PyErr_Format(PyExc_TypeError,
- "list indices must be integers, not %.200s",
+ "list indices must be integers or slices, not %.200s",
item->ob_type->tp_name);
return -1;
}