From 861470c83607a4312d3c65bce3e18414b965e586 Mon Sep 17 00:00:00 2001 From: R David Murray Date: Sun, 5 Oct 2014 11:47:01 -0400 Subject: #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.) --- Objects/bytes_methods.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Objects/bytes_methods.c') diff --git a/Objects/bytes_methods.c b/Objects/bytes_methods.c index 5314ab4c18..1cf20c97d3 100644 --- a/Objects/bytes_methods.c +++ b/Objects/bytes_methods.c @@ -371,7 +371,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; } -- cgit v1.2.1