mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Close #10616: mention bytes and bytearray in PyObject_AsCharBuffer() error
message
This commit is contained in:
parent
2a12974bca
commit
f2a94216de
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue