mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#16518: Bring error messages in harmony with docs ("bytes-like object")
Some time ago we changed the docs to consistently use the term 'bytes-like object' in all the contexts where bytes, bytearray, memoryview, etc are used. This patch (by Ezio Melotti) completes that work by changing the error messages that previously reported that certain types did "not support the buffer interface" to instead say that a bytes-like object is required. (The glossary entry for bytes-like object references the discussion of the buffer protocol in the docs.)
This commit is contained in:
parent
d577cea8ab
commit
861470c836
11 changed files with 30 additions and 22 deletions
|
@ -87,7 +87,7 @@ _getbuffer(PyObject *obj, Py_buffer *view)
|
|||
if (buffer == NULL || buffer->bf_getbuffer == NULL)
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError,
|
||||
"Type %.100s doesn't support the buffer API",
|
||||
"a bytes-like object is required, not '%.100s'",
|
||||
Py_TYPE(obj)->tp_name);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue