From 7798021f03ed937571e9e162e844d368a7fa3b5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Fri, 6 Jul 2018 19:48:33 +0200 Subject: [PATCH] Print Python Errors from setupPlugin() and setupInterface() --- src/plugins/CutterPythonPlugin.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/CutterPythonPlugin.cpp b/src/plugins/CutterPythonPlugin.cpp index 7aa818af..9764edcc 100644 --- a/src/plugins/CutterPythonPlugin.cpp +++ b/src/plugins/CutterPythonPlugin.cpp @@ -47,6 +47,7 @@ void CutterPythonPlugin::setupPlugin(CutterCore *core) PyObject *result = PyObject_CallMethod(pInstance, "setupPlugin", nullptr); if (!result) { qWarning() << "Error in setupPlugin()."; + PyErr_Print(); Python()->saveThread(); } Py_DECREF(result); @@ -79,6 +80,10 @@ CutterDockWidget* CutterPythonPlugin::setupInterface(MainWindow *main, QAction * PyObject *pWidget = nullptr; Python()->restoreThread(); pWidget = PyObject_CallMethod(pInstance, "setupInterface", nullptr); + if (!pWidget) { + qWarning() << "Error in setupInterface()."; + PyErr_Print(); + } Python()->saveThread(); return nullptr;