mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
Fix error messages for buffer objects to say "bytes" instead of "string".
This commit is contained in:
parent
1898084afa
commit
b08340053c
1 changed files with 2 additions and 2 deletions
|
@ -1267,12 +1267,12 @@ convertbuffer(PyObject *arg, void **p, char **errmsg)
|
||||||
*p = NULL;
|
*p = NULL;
|
||||||
if (pb == NULL ||
|
if (pb == NULL ||
|
||||||
pb->bf_getbuffer == NULL) {
|
pb->bf_getbuffer == NULL) {
|
||||||
*errmsg = "string or read-only buffer";
|
*errmsg = "bytes or read-only buffer";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*pb->bf_getbuffer)(arg, &view, PyBUF_SIMPLE) != 0) {
|
if ((*pb->bf_getbuffer)(arg, &view, PyBUF_SIMPLE) != 0) {
|
||||||
*errmsg = "string or single-segment read-only buffer";
|
*errmsg = "bytes or single-segment read-only buffer";
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
count = view.len;
|
count = view.len;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue