static void Pakfire_log_callback(void* data, int priority, const char* file, int line,
const char* fn, const char* format, va_list args) {
PyObject* callback = (PyObject*)data;
+ PyObject* exception = NULL;
// Do nothing if callback isn't set
if (!callback)
result = PyObject_CallObject(callback, tuple);
ERROR:
+ /*
+ We cannot really catch any Python errors here, since we cannot send
+ any error codes up the chain.
+
+ So, in order to debug the problem, We will check if an exception has
+ occurred and if so, print it to the console.
+ */
+ exception = PyErr_Occurred();
+ if (exception)
+ PyErr_Print();
+
if (buffer)
free(buffer);
Py_XDECREF(tuple);