mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Issue #14203: Remove obsolete support for view==NULL in bytesiobuf_getbuffer()
and array_buffer_getbuf().
This commit is contained in:
parent
38c30e6c8e
commit
650c1e818d
6 changed files with 48 additions and 17 deletions
|
@ -2530,7 +2530,11 @@ static const void *emptybuf = "";
|
|||
static int
|
||||
array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags)
|
||||
{
|
||||
if (view==NULL) goto finish;
|
||||
if (view == NULL) {
|
||||
PyErr_SetString(PyExc_BufferError,
|
||||
"array_buffer_getbuf: view==NULL argument is obsolete");
|
||||
return -1;
|
||||
}
|
||||
|
||||
view->buf = (void *)self->ob_item;
|
||||
view->obj = (PyObject*)self;
|
||||
|
@ -2560,7 +2564,6 @@ array_buffer_getbuf(arrayobject *self, Py_buffer *view, int flags)
|
|||
#endif
|
||||
}
|
||||
|
||||
finish:
|
||||
self->ob_exports++;
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue