[HOTFIX] Python module path (Windows)

The pythonPath pointer was not properly enlarged when expanded.
Reduced to the return of Py_DecodeLocale.
This sets the correct size of the pointer at the beginning.
This commit is contained in:
Paulchen Panther 2020-06-28 16:08:19 +02:00 committed by GitHub
parent 00da8c6d8e
commit f9f32c6cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,8 +29,7 @@ PythonInit::PythonInit()
// set Python module path when exists // set Python module path when exists
wchar_t *pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python")).toLatin1().data(), nullptr); wchar_t *pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath() + "/../lib/python")).toLatin1().data(), nullptr);
#ifdef _WIN32 #ifdef _WIN32
pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath())).toLatin1().data(), nullptr); pythonPath = Py_DecodeLocale((QDir::cleanPath(qApp->applicationDirPath()) + "/python" + STRINGIFY(PYTHON_VERSION_MAJOR_MINOR) ".zip").toLatin1().data(), nullptr);
pythonPath = wcscat(pythonPath, L"/python" STRINGIFY(PYTHON_VERSION_MAJOR_MINOR) ".zip");
if(QFile(QString::fromWCharArray(pythonPath)).exists()) if(QFile(QString::fromWCharArray(pythonPath)).exists())
#else #else
if(QDir(QString::fromWCharArray(pythonPath)).exists()) if(QDir(QString::fromWCharArray(pythonPath)).exists())