Merge pull request #80 from Qudix/dll_directory

Fix libffi not found
This commit is contained in:
Mikaël Capelle
2020-11-19 09:36:34 +01:00
committed by GitHub
+8 -2
View File
@@ -1254,8 +1254,10 @@ bool PythonRunner::initPython(const QString &pythonPath)
PySys_SetArgv(0, (wchar_t**)&argBuffer);
bpy::object mainModule = bpy::import("__main__");
bpy::object mainNamespace = mainModule.attr("__dict__");
auto os = bpy::import("os");
auto mainModule = bpy::import("__main__");
auto mainNamespace = mainModule.attr("__dict__");
mainNamespace["os"] = os;
mainNamespace["sys"] = bpy::import("sys");
mainNamespace["moprivate"] = bpy::import("moprivate");
mainNamespace["mobase"] = bpy::import("mobase");
@@ -1265,6 +1267,10 @@ bool PythonRunner::initPython(const QString &pythonPath)
"sys.excepthook = lambda x, y, z: sys.__excepthook__(x, y, z)\n",
mainNamespace);
// add dlls directory
const auto dlls = QCoreApplication::applicationDirPath().toStdString() + "/dlls";
os.attr("add_dll_directory")(dlls);
configure_python_logging(mainNamespace["mobase"]);
PyEval_SaveThread();