diff options
Diffstat (limited to 'sources/pyside2/libpyside')
-rw-r--r-- | sources/pyside2/libpyside/dynamicqmetaobject.cpp | 2 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pyside.cpp | 12 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideproperty.cpp | 7 | ||||
-rw-r--r-- | sources/pyside2/libpyside/pysideqenum.cpp | 2 |
4 files changed, 4 insertions, 19 deletions
diff --git a/sources/pyside2/libpyside/dynamicqmetaobject.cpp b/sources/pyside2/libpyside/dynamicqmetaobject.cpp index 2fbda3f6a..f67e97e01 100644 --- a/sources/pyside2/libpyside/dynamicqmetaobject.cpp +++ b/sources/pyside2/libpyside/dynamicqmetaobject.cpp @@ -569,7 +569,7 @@ void MetaObjectBuilderPrivate::parsePythonType(PyTypeObject *type) // Therefore, we don't need to error-check here again. auto name = String::toCString(obName); AutoDecRef members(PyObject_GetAttr(obEnumType, PyMagicName::members())); - AutoDecRef items(PepMapping_Items(members)); + AutoDecRef items(PyMapping_Items(members)); Py_ssize_t nr_items = PySequence_Length(items); QVector<QPair<QByteArray, int> > entries; 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); diff --git a/sources/pyside2/libpyside/pysideproperty.cpp b/sources/pyside2/libpyside/pysideproperty.cpp index bcb2ab356..30cfabf86 100644 --- a/sources/pyside2/libpyside/pysideproperty.cpp +++ b/sources/pyside2/libpyside/pysideproperty.cpp @@ -354,13 +354,8 @@ static PyObject *qPropertyDocGet(PyObject *self, void *) PySidePropertyPrivate *pData = data->d; QByteArray doc(pData->doc); - if (!doc.isEmpty()) { -#if PY_MAJOR_VERSION >= 3 + if (!doc.isEmpty()) return PyUnicode_FromString(doc); -#else - return PyString_FromString(doc); -#endif - } if (pData->fget != nullptr) { // PYSIDE-1019: Fetch the default `__doc__` from fget. We do it late. AutoDecRef get_doc(PyObject_GetAttr(pData->fget, PyMagicName::doc())); diff --git a/sources/pyside2/libpyside/pysideqenum.cpp b/sources/pyside2/libpyside/pysideqenum.cpp index f46b5536c..07a548cb6 100644 --- a/sources/pyside2/libpyside/pysideqenum.cpp +++ b/sources/pyside2/libpyside/pysideqenum.cpp @@ -66,7 +66,7 @@ static PyObject *analyzePyEnum(PyObject *pyenum, PyObject *container = nullptr) AutoDecRef members(PyObject_GetAttr(pyenum, Shiboken::PyMagicName::members())); if (members.isNull()) return nullptr; - AutoDecRef items(PepMapping_Items(members)); + AutoDecRef items(PyMapping_Items(members)); if (items.isNull()) return nullptr; int iflag = PySide::QEnum::isFlag(pyenum); |