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.
This commit is contained in:
Terry Jan Reedy 2014-08-02 01:30:37 -04:00
parent 7f9cc9359b
commit ffff1440d1
8 changed files with 45 additions and 6 deletions

View file

@ -999,7 +999,7 @@ bytes_subscript(PyBytesObject* self, PyObject* item)
}
else {
PyErr_Format(PyExc_TypeError,
"byte indices must be integers, not %.200s",
"byte indices must be integers or slices, not %.200s",
Py_TYPE(item)->tp_name);
return NULL;
}