From 760cca172f0dbfd057883e8e32de9a38e8638e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sat, 13 Jun 2020 19:04:58 +0200 Subject: [PATCH] Fix Python -> C++ error transfer during plugin creation. --- src/runner/pythonrunner.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index 4678d29..53e914e 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -1049,6 +1049,8 @@ void PythonRunner::appendIfInstance(bpy::object const& obj, QList &int QList PythonRunner::instantiate(const QString &pluginName) { + GILock lock; + // `pluginName` can either be a python file (single-file plugin or a folder (whole module). // // For whole module, we simply add the parent folder to path, then we load the module with a simple @@ -1059,7 +1061,6 @@ QList PythonRunner::instantiate(const QString &pluginName) // from __main__ (already contains mobase, and other required module). Since the context is shared // between called of `instantiate`, we need to make sure to remove createPlugin(s) from previous call. try { - GILock lock; // Dictionary that will contain createPlugin() or createPlugins(). bpy::dict moduleDict;