summaryrefslogtreecommitdiffstats
path: root/Objects/abstract.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-02-03 15:57:21 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-02-03 15:57:21 (GMT)
commit5178d91be09d73900699655b3ddecc0482e7942f (patch)
treef32b40a9dd880cb573ec7d7003a992d7456277e7 /Objects/abstract.c
parent72777614287a3f0feaaf1d0987ec275e94ede280 (diff)
downloadcpython-5178d91be09d73900699655b3ddecc0482e7942f.zip
cpython-5178d91be09d73900699655b3ddecc0482e7942f.tar.gz
cpython-5178d91be09d73900699655b3ddecc0482e7942f.tar.bz2
Issue #14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo()
and bytearray_getbuffer(). Both functions now raise BufferError in that case.
Diffstat (limited to 'Objects/abstract.c')
-rw-r--r--Objects/abstract.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c
index 483f4da..06e3382 100644
--- a/Objects/abstract.c
+++ b/Objects/abstract.c
@@ -612,7 +612,12 @@ int
PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len,
int readonly, int flags)
{
- if (view == NULL) return 0; /* XXX why not -1? */
+ if (view == NULL) {
+ PyErr_SetString(PyExc_BufferError,
+ "PyBuffer_FillInfo: view==NULL argument is obsolete");
+ return -1;
+ }
+
if (((flags & PyBUF_WRITABLE) == PyBUF_WRITABLE) &&
(readonly == 1)) {
PyErr_SetString(PyExc_BufferError,