diff --git a/python/rpmts-py.c b/python/rpmts-py.c index e4c5e12..1ddfc9a 100644 --- a/python/rpmts-py.c +++ b/python/rpmts-py.c @@ -495,6 +495,8 @@ rpmtsCallback(const void * hd, const rpmCallbackType what, if (cbInfo->cb == Py_None) return NULL; + PyEval_RestoreThread(cbInfo->_save); + /* Synthesize a python object for callback (if necessary). */ if (pkgObj == NULL) { if (h) { @@ -506,8 +508,6 @@ rpmtsCallback(const void * hd, const rpmCallbackType what, } else Py_INCREF(pkgObj); - PyEval_RestoreThread(cbInfo->_save); - args = Py_BuildValue("(iLLOO)", what, amount, total, pkgObj, cbInfo->data); result = PyEval_CallObject(cbInfo->cb, args); Py_DECREF(args);