mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Workaround for 'PyPy does not yet implement the new buffer interface' bug
This commit is contained in:
parent
980785952f
commit
01e31bfd84
|
@ -251,7 +251,9 @@ int PyImaging_GetBuffer(PyObject* buffer, Py_buffer *view)
|
|||
/* Use new buffer protocol if available
|
||||
(mmap doesn't support this in 2.7, go figure) */
|
||||
if (PyObject_CheckBuffer(buffer)) {
|
||||
return PyObject_GetBuffer(buffer, view, PyBUF_SIMPLE);
|
||||
int success = PyObject_GetBuffer(buffer, view, PyBUF_SIMPLE);
|
||||
if (!success) { return success; }
|
||||
PyErr_Clear();
|
||||
}
|
||||
|
||||
/* Pretend we support the new protocol; PyBuffer_Release happily ignores
|
||||
|
|
Loading…
Reference in New Issue
Block a user