Print Python Errors from setupPlugin() and setupInterface()

This commit is contained in:
Florian Märkl 2018-07-06 19:48:33 +02:00
parent 73c40da3f9
commit 7798021f03

View File

@ -47,6 +47,7 @@ void CutterPythonPlugin::setupPlugin(CutterCore *core)
PyObject *result = PyObject_CallMethod(pInstance, "setupPlugin", nullptr); PyObject *result = PyObject_CallMethod(pInstance, "setupPlugin", nullptr);
if (!result) { if (!result) {
qWarning() << "Error in setupPlugin()."; qWarning() << "Error in setupPlugin().";
PyErr_Print();
Python()->saveThread(); Python()->saveThread();
} }
Py_DECREF(result); Py_DECREF(result);
@ -79,6 +80,10 @@ CutterDockWidget* CutterPythonPlugin::setupInterface(MainWindow *main, QAction *
PyObject *pWidget = nullptr; PyObject *pWidget = nullptr;
Python()->restoreThread(); Python()->restoreThread();
pWidget = PyObject_CallMethod(pInstance, "setupInterface", nullptr); pWidget = PyObject_CallMethod(pInstance, "setupInterface", nullptr);
if (!pWidget) {
qWarning() << "Error in setupInterface().";
PyErr_Print();
}
Python()->saveThread(); Python()->saveThread();
return nullptr; return nullptr;