summaryrefslogtreecommitdiff
path: root/python/cache.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2009-07-17 20:51:27 +0200
committerJulian Andres Klode <jak@debian.org>2009-07-17 20:51:27 +0200
commit61481860f4e260e56e123811b759c8d8bd3353db (patch)
tree2a62975f8f7ec23c05af4b2af1e9fe8a98abfe6c /python/cache.cc
parent3b23463156a4e119c520e0e45df09d04b815bebe (diff)
downloadpython-apt-61481860f4e260e56e123811b759c8d8bd3353db.tar.gz
python/cache.cc: Only support new OpProgress() objects in apt_pkg.Cache().
Diffstat (limited to 'python/cache.cc')
-rw-r--r--python/cache.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/python/cache.cc b/python/cache.cc
index c1f9eb2b..f5effae9 100644
--- a/python/cache.cc
+++ b/python/cache.cc
@@ -245,8 +245,16 @@ static PyObject *PkgCacheNew(PyTypeObject *type,PyObject *Args,PyObject *kwds)
{
PyObject *pyCallbackInst = 0;
char *kwlist[] = {"progress", 0};
- if (PyArg_ParseTupleAndKeywords (Args, kwds, "|O", kwlist, &pyCallbackInst) == 0)
+
+ #ifdef COMPAT_0_7
+ if (PyArg_ParseTupleAndKeywords(Args, kwds, "|O", kwlist,
+ &pyCallbackInst) == 0)
+ return 0;
+ #else
+ if (PyArg_ParseTupleAndKeywords(Args, kwds, "|O!", kwlist,
+ &PyOpProgress_Type, &pyCallbackInst) == 0)
return 0;
+ #endif
if (_system == 0) {
PyErr_SetString(PyExc_ValueError,"_system not initialized");