diff options
author | Christian Tismer <tismer@stackless.com> | 2020-10-27 17:09:45 +0100 |
---|---|---|
committer | Christian Tismer <tismer@stackless.com> | 2020-10-27 21:13:56 +0000 |
commit | 5de0db2391c719ef6c484813cc4aee61da355160 (patch) | |
tree | 93facde76f304de3118477d90163108e97018d09 /sources/pyside2/libpyside/pyside.cpp | |
parent | dcced0742f383b1932d0e56323387fbd8aeb4513 (diff) |
remove traces of Python2 from C code
It will be assumed that Python is always Python 3.
All checks for Python 2 are removed.
This is the second part of cleaning up the C code
from references to Python 2.
Task-number: PYSIDE-904
Change-Id: I3006412c2a5bb65402101b0aac5a5f2fc79ce2f8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside2/libpyside/pyside.cpp')
-rw-r--r-- | sources/pyside2/libpyside/pyside.cpp | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/sources/pyside2/libpyside/pyside.cpp b/sources/pyside2/libpyside/pyside.cpp index 2404788d3..4995f35dd 100644 --- a/sources/pyside2/libpyside/pyside.cpp +++ b/sources/pyside2/libpyside/pyside.cpp @@ -533,17 +533,7 @@ bool registerInternalQtConf() // This will disable the internal qt.conf which points to the PySide2 subdirectory (due to the // subdirectory not existing anymore). QString executablePath = -#if PY_MAJOR_VERSION >= 3 - QString::fromWCharArray(Py_GetProgramFullPath()); -#else - // Python 2 unfortunately returns a char * array instead of a wchar *, which means that on - // Windows if the executable path contains unicode characters, the returned path will be - // invalid. We can't use QCoreApplication::applicationFilePath because it requires an - // existing QCoreApplication instance despite being a static method. - // This means that a qt.conf near an executable won't be picked up correctly on - // Windows + Python 2. - QString::fromLocal8Bit(Py_GetProgramFullPath()); -#endif + QString::fromWCharArray(Py_GetProgramFullPath()); QString appDirPath = QFileInfo(executablePath).absolutePath(); QString maybeQtConfPath = QDir(appDirPath).filePath(QStringLiteral("qt.conf")); bool executableQtConfAvailable = QFileInfo::exists(maybeQtConfPath); |