py2.6 support

This commit is contained in:
wiredfool 2016-05-29 14:36:40 -07:00
parent fa81287f2c
commit 71333fcdbe
2 changed files with 2 additions and 1 deletions

View File

@ -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;

1
py3.h
View File

@ -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#"