From ecc6c081af8f4247562f593f5318c2905ef78795 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 28 May 2013 20:20:35 -0700 Subject: [PATCH] Use PyCapsule for py3.1, fixes #237 --- _imaging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_imaging.c b/_imaging.c index ea31018ec..8e30e5902 100644 --- a/_imaging.c +++ b/_imaging.c @@ -3044,7 +3044,7 @@ _getattr_id(ImagingObject* self, void* closure) static PyObject* _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); #else return PyCObject_FromVoidPtrAndDesc(self->image, IMAGING_MAGIC, NULL);