diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:25:22 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-12-05 20:25:22 (GMT) |
commit | b757c83ec626442a8804b9417790443bf13b4fc8 (patch) | |
tree | e9361287f1239fa9758a9387cbd7aa9096a76601 /Modules | |
parent | 6b335196c50049685e5fd2dc420cbba68de489e8 (diff) | |
download | cpython-b757c83ec626442a8804b9417790443bf13b4fc8.zip cpython-b757c83ec626442a8804b9417790443bf13b4fc8.tar.gz cpython-b757c83ec626442a8804b9417790443bf13b4fc8.tar.bz2 |
Issue #22581: Use more "bytes-like object" throughout the docs and comments.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/arraymodule.c | 4 | ||||
-rw-r--r-- | Modules/socketmodule.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 24f0ea0..5ab1ab6 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -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; diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index b37e793..cb44d05 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -3493,7 +3493,7 @@ sock_sendmsg(PySocketSockObject *s, PyObject *args) for (; ndatabufs < ndataparts; ndatabufs++) { if (!PyArg_Parse(PySequence_Fast_GET_ITEM(data_fast, ndatabufs), "y*;sendmsg() argument 1 must be an iterable of " - "buffer-compatible objects", + "bytes-like objects", &databufs[ndatabufs])) goto finally; iovs[ndatabufs].iov_base = databufs[ndatabufs].buf; @@ -3650,12 +3650,12 @@ PyDoc_STRVAR(sendmsg_doc, Send normal and ancillary data to the socket, gathering the\n\ non-ancillary data from a series of buffers and concatenating it into\n\ a single message. The buffers argument specifies the non-ancillary\n\ -data as an iterable of buffer-compatible objects (e.g. bytes objects).\n\ +data as an iterable of bytes-like objects (e.g. bytes objects).\n\ The ancdata argument specifies the ancillary data (control messages)\n\ as an iterable of zero or more tuples (cmsg_level, cmsg_type,\n\ cmsg_data), where cmsg_level and cmsg_type are integers specifying the\n\ protocol level and protocol-specific type respectively, and cmsg_data\n\ -is a buffer-compatible object holding the associated data. The flags\n\ +is a bytes-like object holding the associated data. The flags\n\ argument defaults to 0 and has the same meaning as for send(). If\n\ address is supplied and not None, it sets a destination address for\n\ the message. The return value is the number of bytes of non-ancillary\n\ |