Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error

message
This commit is contained in:
Victor Stinner 2011-05-30 23:21:30 +02:00
parent 2a12974bca
commit f2a94216de
1 changed files with 2 additions and 1 deletions

View File

@ -237,7 +237,8 @@ PyObject_AsCharBuffer(PyObject *obj,
pb = obj->ob_type->tp_as_buffer;
if (pb == NULL || pb->bf_getbuffer == NULL) {
PyErr_SetString(PyExc_TypeError,
"expected an object with the buffer interface");
"expected bytes, bytearray "
"or buffer compatible object");
return -1;
}
if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;