mirror of
https://github.com/python/cpython.git
synced 2025-11-01 02:38:53 +00:00
Issue #14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo()
and bytearray_getbuffer(). Both functions now raise BufferError in that case.
This commit is contained in:
parent
7277761428
commit
5178d91be0
4 changed files with 51 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue