From 71333fcdbe2fb4f63748938eb0c36860e6a85316 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Sun, 29 May 2016 14:36:40 -0700 Subject: [PATCH] py2.6 support --- decode.c | 2 +- py3.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/decode.c b/decode.c index df71658f6..58ba396a4 100644 --- a/decode.c +++ b/decode.c @@ -938,7 +938,7 @@ _imaging_tell_pyFd(PyObject *fd) Py_ssize_t location; result = PyObject_CallMethod(fd, "tell", NULL); - location = PyLong_AsSsize_t(result); + location = PyInt_AsSsize_t(result); Py_DECREF(result); return location; diff --git a/py3.h b/py3.h index 8adfac081..a2a1e264f 100644 --- a/py3.h +++ b/py3.h @@ -19,6 +19,7 @@ #define PyInt_FromLong PyLong_FromLong #define PyInt_AS_LONG PyLong_AS_LONG #define PyInt_FromSsize_t PyLong_FromSsize_t +#define PyInt_AsSsize_t PyLong_AsSsize_t #else /* PY_VERSION_HEX < 0x03000000 */ #define PY_ARG_BYTES_LENGTH "s#"