mirror of
https://github.com/python/cpython
synced 2026-09-29 09:55:31 +03:00
Fixing the spelling of "writeable" to "writable", particularly PyBUF_WRITEABLE.
This commit is contained in:
parent
a5b8e04bd5
commit
54cf12b625
13 changed files with 33 additions and 31 deletions
|
|
@ -304,9 +304,9 @@ int PyObject_AsWriteBuffer(PyObject *obj,
|
|||
pb = obj->ob_type->tp_as_buffer;
|
||||
if (pb == NULL ||
|
||||
pb->bf_getbuffer == NULL ||
|
||||
((*pb->bf_getbuffer)(obj, &view, PyBUF_WRITEABLE) != 0)) {
|
||||
((*pb->bf_getbuffer)(obj, &view, PyBUF_WRITABLE) != 0)) {
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"expected an object with a writeable buffer interface");
|
||||
"expected an object with a writable buffer interface");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -659,10 +659,10 @@ PyBuffer_FillInfo(PyBuffer *view, void *buf, Py_ssize_t len,
|
|||
"Cannot make this object read-only.");
|
||||
return -1;
|
||||
}
|
||||
if (((flags & PyBUF_WRITEABLE) == PyBUF_WRITEABLE) &&
|
||||
if (((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) &&
|
||||
readonly == 1) {
|
||||
PyErr_SetString(PyExc_BufferError,
|
||||
"Object is not writeable.");
|
||||
"Object is not writable.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -183,8 +183,8 @@ _indirect_copy_nd(char *dest, PyBuffer *view, char fort)
|
|||
buffertype
|
||||
|
||||
PyBUF_READ buffer only needs to be read-only
|
||||
PyBUF_WRITE buffer needs to be writeable (give error if not contiguous)
|
||||
PyBUF_SHADOW buffer needs to be writeable so shadow it with
|
||||
PyBUF_WRITE buffer needs to be writable (give error if not contiguous)
|
||||
PyBUF_SHADOW buffer needs to be writable so shadow it with
|
||||
a contiguous buffer if it is not. The view will point to
|
||||
the shadow buffer which can be written to and then
|
||||
will be copied back into the other buffer when the memory
|
||||
|
|
@ -235,7 +235,7 @@ PyMemoryView_GetContiguous(PyObject *obj, int buffertype, char fort)
|
|||
if (buffertype == PyBUF_WRITE) {
|
||||
PyObject_DEL(mem);
|
||||
PyErr_SetString(PyExc_BufferError,
|
||||
"writeable contiguous buffer requested for a non-contiguous" \
|
||||
"writable contiguous buffer requested for a non-contiguous" \
|
||||
"object.");
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue