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.
diff --git a/Objects/bytesobject.c b/Objects/bytesobject.c
index aff09cd..ca565eb 100644
--- a/Objects/bytesobject.c
+++ b/Objects/bytesobject.c
@@ -999,7 +999,7 @@
}
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;
}