mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
Merge pull request #2294 from wiredfool/pypy-buffer-workaround
PyPy buffer interface workaround
This commit is contained in:
commit
9c1b9e71a6
|
@ -16,6 +16,8 @@ python:
|
||||||
- 3.4
|
- 3.4
|
||||||
- nightly
|
- nightly
|
||||||
|
|
||||||
|
dist: trusty
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- "travis_retry sudo apt-get update"
|
- "travis_retry sudo apt-get update"
|
||||||
- "travis_retry sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-qt4 ghostscript libffi-dev libjpeg-turbo-progs cmake imagemagick"
|
- "travis_retry sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-qt4 ghostscript libffi-dev libjpeg-turbo-progs cmake imagemagick"
|
||||||
|
|
7
Makefile
7
Makefile
|
@ -58,6 +58,13 @@ install:
|
||||||
python setup.py install
|
python setup.py install
|
||||||
python selftest.py --installed
|
python selftest.py --installed
|
||||||
|
|
||||||
|
debug:
|
||||||
|
# make a debug version if we don't have a -dbg python. Leaves in symbols
|
||||||
|
# for our stuff, kills optimization, and redirects to dev null so we
|
||||||
|
# see any build failures.
|
||||||
|
make clean > /dev/null
|
||||||
|
CFLAGS='-g -O0' python setup.py build_ext install > /dev/null
|
||||||
|
|
||||||
install-req:
|
install-req:
|
||||||
pip install -r requirements.txt
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,9 @@ int PyImaging_GetBuffer(PyObject* buffer, Py_buffer *view)
|
||||||
/* Use new buffer protocol if available
|
/* Use new buffer protocol if available
|
||||||
(mmap doesn't support this in 2.7, go figure) */
|
(mmap doesn't support this in 2.7, go figure) */
|
||||||
if (PyObject_CheckBuffer(buffer)) {
|
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
|
/* Pretend we support the new protocol; PyBuffer_Release happily ignores
|
||||||
|
|
Loading…
Reference in New Issue
Block a user