mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
Use PyCapsule for py3.1, fixes #237
This commit is contained in:
parent
d7f4459fb2
commit
ecc6c081af
|
@ -3044,7 +3044,7 @@ _getattr_id(ImagingObject* self, void* closure)
|
||||||
static PyObject*
|
static PyObject*
|
||||||
_getattr_ptr(ImagingObject* self, void* closure)
|
_getattr_ptr(ImagingObject* self, void* closure)
|
||||||
{
|
{
|
||||||
#if PY_VERSION_HEX >= 0x03020000
|
#if (PY_VERSION_HEX >= 0x02070000 && PY_VERSION_HEX < 0x03000000) || PY_VERSION_HEX >= 0x03010000
|
||||||
return PyCapsule_New(self->image, IMAGING_MAGIC, NULL);
|
return PyCapsule_New(self->image, IMAGING_MAGIC, NULL);
|
||||||
#else
|
#else
|
||||||
return PyCObject_FromVoidPtrAndDesc(self->image, IMAGING_MAGIC, NULL);
|
return PyCObject_FromVoidPtrAndDesc(self->image, IMAGING_MAGIC, NULL);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user