summaryrefslogtreecommitdiff
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-02-03 21:43:23 +0100
committerStefan Krah <skrah@bytereef.org>2015-02-03 21:43:23 +0100
commit650c1e818d7bbb5d51501051fca773b3b8ea6bf3 (patch)
tree5fdc035e52a060552f90293c04f8df9537e86def /Modules/arraymodule.c
parent38c30e6c8e34241a1ea226fdd4ff74be6a8ee846 (diff)
downloadcpython-git-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.tar.gz
Issue #14203: Remove obsolete support for view==NULL in bytesiobuf_getbuffer()
and array_buffer_getbuf().
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index 87bdb2c813..6e755f4fcf 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -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;
}