diff options
author | Stefan Krah <skrah@bytereef.org> | 2015-02-03 20:43:23 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2015-02-03 20:43:23 (GMT) |
commit | 650c1e818d7bbb5d51501051fca773b3b8ea6bf3 (patch) | |
tree | 5fdc035e52a060552f90293c04f8df9537e86def /Modules/arraymodule.c | |
parent | 38c30e6c8e34241a1ea226fdd4ff74be6a8ee846 (diff) | |
download | cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.zip cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.tar.gz cpython-650c1e818d7bbb5d51501051fca773b3b8ea6bf3.tar.bz2 |
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.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 87bdb2c..6e755f4 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; } |