Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix python Py_SetPath() deprecation by always using qputenv()

Dov Grobgelddc514f350419
diff --git a/plugins/extensions/pykrita/plugin/utilities.cpp b/plugins/extensions/pykrita/plugin/utilities.cpp
index 4f58183238..fe2608297a 100644
--- a/plugins/extensions/pykrita/plugin/utilities.cpp
+++ b/plugins/extensions/pykrita/plugin/utilities.cpp
@@ -412,20 +412,8 @@ bool Python::setPath(const QStringList& scriptPaths)
joinedPaths = joinedPaths + pathSeparator + originalPath;
}
dbgScript << "Setting python paths:" << joinedPaths;
-#ifdef Q_OS_WIN
- QVector<wchar_t> joinedPathsWChars(joinedPaths.size() + 1, 0);
- joinedPaths.toWCharArray(joinedPathsWChars.data());
- Py_SetPath(joinedPathsWChars.data());
-#else
- if (runningInBundle) {
- QVector<wchar_t> joinedPathsWChars(joinedPaths.size() + 1, 0);
- joinedPaths.toWCharArray(joinedPathsWChars.data());
- Py_SetPath(joinedPathsWChars.data());
- }
- else {
- qputenv("PYTHONPATH", joinedPaths.toLocal8Bit());
- }
-#endif
+ qputenv("PYTHONPATH", joinedPaths.toLocal8Bit());
+
isPythonPathSet = true;
return true;
}