From 61481860f4e260e56e123811b759c8d8bd3353db Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 17 Jul 2009 20:51:27 +0200 Subject: python/cache.cc: Only support new OpProgress() objects in apt_pkg.Cache(). --- python/cache.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'python/cache.cc') 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"); -- cgit v1.2.3