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 /Objects | |
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 'Objects')
-rw-r--r-- | Objects/stringlib/join.h | 6 | ||||
-rw-r--r-- | Objects/unicodeobject.c | 3 |
2 files changed, 4 insertions, 5 deletions
diff --git a/Objects/stringlib/join.h b/Objects/stringlib/join.h index 5568b31..35eb984 100644 --- a/Objects/stringlib/join.h +++ b/Objects/stringlib/join.h @@ -53,15 +53,15 @@ STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable) /* Here is the general case. Do a pre-pass to figure out the total * amount of space we'll need (sz), and see whether all arguments are - * buffer-compatible. + * bytes-like. */ for (i = 0, nbufs = 0; i < seqlen; i++) { Py_ssize_t itemlen; item = PySequence_Fast_GET_ITEM(seq, i); if (_getbuffer(item, &buffers[i]) < 0) { PyErr_Format(PyExc_TypeError, - "sequence item %zd: expected bytes, bytearray, " - "or an object with the buffer interface, %.80s found", + "sequence item %zd: expected a bytes-like object, " + "%.80s found", i, Py_TYPE(item)->tp_name); goto error; } diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 70728f8..8a13f2c 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2940,8 +2940,7 @@ PyUnicode_FromEncodedObject(PyObject *obj, /* Retrieve a bytes buffer view through the PEP 3118 buffer interface */ if (PyObject_GetBuffer(obj, &buffer, PyBUF_SIMPLE) < 0) { PyErr_Format(PyExc_TypeError, - "coercing to str: need bytes, bytearray " - "or buffer-like object, %.80s found", + "coercing to str: need a bytes-like object, %.80s found", Py_TYPE(obj)->tp_name); return NULL; } |