From 0d7ffbdfcecfde690648da1ff9342d3bd736e71f Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Sep 2006 18:40:30 +0200 Subject: * fix api changes for python2.5 --- python/cache.cc | 8 ++++---- python/tag.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'python') diff --git a/python/cache.cc b/python/cache.cc index 174423c2..b6278de0 100644 --- a/python/cache.cc +++ b/python/cache.cc @@ -287,12 +287,12 @@ PyTypeObject PkgCacheFileType = /*}}}*/ // Package List Class /*{{{*/ // --------------------------------------------------------------------- -static int PkgListLen(PyObject *Self) +static Py_ssize_t PkgListLen(PyObject *Self) { return GetCpp(Self).Iter.Cache()->HeaderP->PackageCount; } -static PyObject *PkgListItem(PyObject *iSelf,int Index) +static PyObject *PkgListItem(PyObject *iSelf,Py_ssize_t Index) { PkgListStruct &Self = GetCpp(iSelf); if (Index < 0 || (unsigned)Index >= Self.Iter.Cache()->HeaderP->PackageCount) @@ -815,12 +815,12 @@ PyTypeObject DependencyType = /*}}}*/ // Reverse Dependency List Class /*{{{*/ // --------------------------------------------------------------------- -static int RDepListLen(PyObject *Self) +static Py_ssize_t RDepListLen(PyObject *Self) { return GetCpp(Self).Len; } -static PyObject *RDepListItem(PyObject *iSelf,int Index) +static PyObject *RDepListItem(PyObject *iSelf,Py_ssize_t Index) { RDepListStruct &Self = GetCpp(iSelf); if (Index < 0 || (unsigned)Index >= Self.Len) diff --git a/python/tag.cc b/python/tag.cc index 41db059c..883a8eab 100644 --- a/python/tag.cc +++ b/python/tag.cc @@ -132,7 +132,7 @@ static PyObject *TagSecMap(PyObject *Self,PyObject *Arg) } // len() operation -static int TagSecLength(PyObject *Self) +static Py_ssize_t TagSecLength(PyObject *Self) { pkgTagSection &Sec = GetCpp(Self); return Sec.Count(); -- cgit v1.2.3 From ddfb5f9abcc398843e48885bbc8b3e4439c14e7b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 18 Sep 2006 19:26:55 +0200 Subject: * python/generic.h: - deal with the api change and stay backward compatible with 2.4 --- python/generic.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python') diff --git a/python/generic.h b/python/generic.h index a808e28d..b47ed1a2 100644 --- a/python/generic.h +++ b/python/generic.h @@ -31,6 +31,10 @@ #include #include +#if PYTHON_API_VERSION < 1013 +typedef int Py_ssize_t; +#endif + template struct CppPyObject : public PyObject { // We are only using CppPyObject and friends as dumb structs only, ie the -- cgit v1.2.3