[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
1 changed files with 1 additions and 2 deletions

View File

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