diff options
| -rw-r--r-- | python/cache.cc | 10 |
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"); |
