mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
Issue #22581: Use more "bytes-like object" throughout the docs and comments.
This commit is contained in:
parent
6b335196c5
commit
b757c83ec6
12 changed files with 39 additions and 37 deletions
|
@ -1441,14 +1441,14 @@ frombytes(arrayobject *self, Py_buffer *buffer)
|
|||
Py_ssize_t n;
|
||||
if (buffer->itemsize != 1) {
|
||||
PyBuffer_Release(buffer);
|
||||
PyErr_SetString(PyExc_TypeError, "string/buffer of bytes required.");
|
||||
PyErr_SetString(PyExc_TypeError, "a bytes-like object is required");
|
||||
return NULL;
|
||||
}
|
||||
n = buffer->len;
|
||||
if (n % itemsize != 0) {
|
||||
PyBuffer_Release(buffer);
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"string length not a multiple of item size");
|
||||
"bytes length not a multiple of item size");
|
||||
return NULL;
|
||||
}
|
||||
n = n / itemsize;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue