mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Eliminate use of PyBUF_CHARACTER flag which is no longer part of the buffer interface. Fix up array module to export the correct format for wide-builds.
This commit is contained in:
parent
d417a154e4
commit
ddacf96868
5 changed files with 20 additions and 23 deletions
|
|
@ -236,7 +236,7 @@ PyObject_AsCharBuffer(PyObject *obj,
|
|||
"expected an object with the buffer interface");
|
||||
return -1;
|
||||
}
|
||||
if ((*pb->bf_getbuffer)(obj, &view, PyBUF_CHARACTER)) return -1;
|
||||
if ((*pb->bf_getbuffer)(obj, &view, PyBUF_SIMPLE)) return -1;
|
||||
|
||||
*buffer = view.buf;
|
||||
*buffer_len = view.len;
|
||||
|
|
|
|||
|
|
@ -8117,10 +8117,6 @@ static int
|
|||
unicode_buffer_getbuffer(PyUnicodeObject *self, Py_buffer *view, int flags)
|
||||
{
|
||||
|
||||
if (flags & PyBUF_CHARACTER) {
|
||||
PyErr_SetString(PyExc_SystemError, "can't use str as char buffer");
|
||||
return -1;
|
||||
}
|
||||
return PyBuffer_FillInfo(view, (void *)self->str,
|
||||
PyUnicode_GET_DATA_SIZE(self), 1, flags);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue