Issue #14181: Preserve backwards compatibility for getbufferprocs that a) do

not adhere to the new documentation and b) manage to clobber view->obj before
returning failure.
This commit is contained in:
Stefan Krah 2012-03-05 17:45:17 +01:00
parent bf6c7eca43
commit 1649c1b33a
3 changed files with 23 additions and 16 deletions

View file

@ -86,7 +86,7 @@ _PyManagedBuffer_FromObject(PyObject *base)
return NULL;
if (PyObject_GetBuffer(base, &mbuf->master, PyBUF_FULL_RO) < 0) {
/* mbuf->master.obj must be NULL. */
mbuf->master.obj = NULL;
Py_DECREF(mbuf);
return NULL;
}