From e5ac21442fd68441fcf470ae84a10c1c04a3a91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Wed, 3 Mar 2021 20:44:20 +0100 Subject: [PATCH] Import mobase after installing the exception wrapper. --- 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 0639270..6578059 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -1328,13 +1328,14 @@ bool PythonRunner::initPython(const QString &pythonPath) bpy::object mainNamespace = mainModule.attr("__dict__"); mainNamespace["sys"] = bpy::import("sys"); mainNamespace["moprivate"] = bpy::import("moprivate"); - mainNamespace["mobase"] = bpy::import("mobase"); bpy::import("site"); bpy::exec("sys.stdout = moprivate.PrintWrapper()\n" "sys.stderr = moprivate.ErrWrapper.instance()\n" "sys.excepthook = lambda x, y, z: sys.__excepthook__(x, y, z)\n", mainNamespace); + + mainNamespace["mobase"] = bpy::import("mobase"); configure_python_logging(mainNamespace["mobase"]); PyEval_SaveThread();