From 1928a8fab432b219c6286ff08b142c57c6df5e6b Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Mon, 15 Jun 2009 10:56:01 +0200 Subject: * python/progress.cc: - fix crash in RunSimpleCallback() * apt/cache.py: - when the cache is run with a alternative rootdir, create required dirs/files automatically --- python/progress.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'python/progress.cc') diff --git a/python/progress.cc b/python/progress.cc index 14948d3c..95cece3b 100644 --- a/python/progress.cc +++ b/python/progress.cc @@ -27,9 +27,12 @@ bool PyCallbackObj::RunSimpleCallback(const char* method_name, PyObject *method = PyObject_GetAttrString(callbackInst,(char*) method_name); if(method == NULL) { - // FIXME: make this silent //std::cerr << "Can't find '" << method_name << "' method" << std::endl; Py_XDECREF(arglist); + if (res) { + Py_INCREF(Py_None); + *res = Py_None; + } return false; } PyObject *result = PyEval_CallObject(method, arglist); -- cgit v1.2.3