diff options
Diffstat (limited to 'python/rpmmodule.c')
-rw-r--r-- | python/rpmmodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/python/rpmmodule.c b/python/rpmmodule.c index d1de9790c..2ac4aba8b 100644 --- a/python/rpmmodule.c +++ b/python/rpmmodule.c @@ -186,6 +186,7 @@ static PyObject * findUpgradeSet(PyObject * self, PyObject * args) */ static PyObject * errorCB = NULL; static PyObject * errorData = NULL; +static PyThreadState * errorThread = NULL; /** */ @@ -193,6 +194,8 @@ static void errorcb (void) { PyObject * result, * args = NULL; + PyEval_RestoreThread(errorThread); + if (errorData) args = Py_BuildValue("(O)", errorData); @@ -203,6 +206,9 @@ static void errorcb (void) PyErr_Print(); PyErr_Clear(); } + + errorThread = PyEval_SaveThread(); + Py_DECREF (result); } @@ -240,6 +246,7 @@ static PyObject * errorSetCallback (PyObject * self, PyObject * args) errorCB = newCB; errorData = newData; + errorThread = PyEval_SaveThread(); Py_INCREF (errorCB); Py_XINCREF (errorData); |