[HotFix] Release 2.0.0-alpha.11

This commit is contained in:
Markus
2021-10-05 21:22:19 +00:00
committed by GitHub
parent 672354fb5c
commit 2c79656b4a
8 changed files with 46 additions and 25 deletions

View File

@@ -11,6 +11,9 @@
// modules to init
#include <effectengine/EffectModule.h>
// Required to determine the cmake options
#include <HyperionConfig.h>
#ifdef _WIN32
#include <stdexcept>
#endif
@@ -23,12 +26,13 @@ PythonInit::PythonInit()
// register modules
EffectModule::registerHyperionExtensionModule();
#if defined(ENABLE_DEPLOY_DEPENDENCIES)
// Set Program name
Py_SetProgramName(L"Hyperion");
// set Python module path when exists
QString py_patch = QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python" + STRINGIFY(PYTHON_VERSION_MAJOR_MINOR));
QString py_file = QDir::cleanPath(qApp->applicationDirPath() + "/python" + STRINGIFY(PYTHON_VERSION_MAJOR_MINOR) + ".zip");
QString py_patch = QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python" + STRINGIFY(PYTHON_VERSION_MAJOR) + "." + STRINGIFY(PYTHON_VERSION_MINOR));
QString py_file = QDir::cleanPath(qApp->applicationDirPath() + "/python" + STRINGIFY(PYTHON_VERSION_MAJOR) + STRINGIFY(PYTHON_VERSION_MINOR) + ".zip");
if (QFile(py_file).exists() || QDir(py_patch).exists())
{
@@ -40,10 +44,11 @@ PythonInit::PythonInit()
}
else if (QDir(py_patch).exists())
{
Py_SetPythonHome(Py_DecodeLocale(py_file.toLatin1().data(), nullptr));
Py_SetPythonHome(Py_DecodeLocale(py_patch.toLatin1().data(), nullptr));
Py_SetPath(Py_DecodeLocale(py_patch.toLatin1().data(), nullptr));
}
}
#endif
// init Python
Debug(Logger::getInstance("DAEMON"), "Initializing Python interpreter");