diff options
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | sources/shiboken6/libshiboken/pep384impl.cpp | 22 | ||||
| -rw-r--r-- | sources/shiboken6/libshiboken/pep384impl.h | 3 | ||||
| -rw-r--r-- | sources/shiboken6/libshiboken/sbkpython.h | 33 | ||||
| -rw-r--r-- | sources/shiboken6/libshiboken/sbkstring.cpp | 2 | ||||
| -rw-r--r-- | sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py | 2 |
6 files changed, 14 insertions, 50 deletions
@@ -90,7 +90,7 @@ using `setup.py build`: * `--ignore-git`, will skip the fetching and checkout steps for supermodule and all submodules. * `--limited-api=yes|no`, default yes if applicable. Set or clear the limited - API flag. Ignored for Python 2. + API flag. * `--module-subset`, allows for specifying the Qt modules to be built. A minimal set is: `--module-subset=Core,Gui,Test,Widgets`. * `--package-timestamp`, allows specifying the timestamp that will be used as diff --git a/sources/shiboken6/libshiboken/pep384impl.cpp b/sources/shiboken6/libshiboken/pep384impl.cpp index 283b2f3be..dbc0aa88b 100644 --- a/sources/shiboken6/libshiboken/pep384impl.cpp +++ b/sources/shiboken6/libshiboken/pep384impl.cpp @@ -743,7 +743,7 @@ static PyTypeObject *getFunctionType(void) "from types import FunctionType as result\n"; return reinterpret_cast<PyTypeObject *>(PepRun_GetResult(prog)); } -#endif // Py_LIMITED_API || Python 2 +#endif // Py_LIMITED_API /***************************************************************************** * @@ -920,12 +920,6 @@ PyTypeObject *PepType_Type_tp_new(PyTypeObject *metatype, PyObject *args, PyObje * */ -#ifdef Py_LIMITED_API -// We keep these definitions local, because they don't work in Python 2. -# define PyUnicode_GET_LENGTH(op) PyUnicode_GetLength((PyObject *)(op)) -# define PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar((PyObject *)(u), (i)) -#endif // Py_LIMITED_API - PyObject * _Pep_PrivateMangle(PyObject *self, PyObject *name) { @@ -934,15 +928,15 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name) * This function is modelled after _Py_Mangle, but is optimized * a little for our purpose. */ - if (PyUnicode_READ_CHAR(name, 0) != '_' || - PyUnicode_READ_CHAR(name, 1) != '_') { + if (PyUnicode_ReadChar(name, 0) != '_' || + PyUnicode_ReadChar(name, 1) != '_') { Py_INCREF(name); return name; } - const Py_ssize_t nlen = PyUnicode_GET_LENGTH(name); + const Py_ssize_t nlen = PyUnicode_GetLength(name); /* Don't mangle __id__ or names with dots. */ - if ((PyUnicode_READ_CHAR(name, nlen-1) == '_' && - PyUnicode_READ_CHAR(name, nlen-2) == '_') || + if ((PyUnicode_ReadChar(name, nlen-1) == '_' && + PyUnicode_ReadChar(name, nlen-2) == '_') || PyUnicode_FindChar(name, '.', 0, nlen, 1) != -1) { Py_INCREF(name); return name; @@ -953,10 +947,10 @@ _Pep_PrivateMangle(PyObject *self, PyObject *name) // PYSIDE-1436: _Py_Mangle is no longer exposed; implement it always. // The rest of this function is our own implementation of _Py_Mangle. // Please compare the original function in compile.c . - Py_ssize_t plen = PyUnicode_GET_LENGTH(privateobj.object()); + Py_ssize_t plen = PyUnicode_GetLength(privateobj.object()); /* Strip leading underscores from class name */ Py_ssize_t ipriv = 0; - while (PyUnicode_READ_CHAR(privateobj.object(), ipriv) == '_') + while (PyUnicode_ReadChar(privateobj.object(), ipriv) == '_') ipriv++; if (ipriv == plen) { Py_INCREF(name); diff --git a/sources/shiboken6/libshiboken/pep384impl.h b/sources/shiboken6/libshiboken/pep384impl.h index 0612d05cd..d3d644649 100644 --- a/sources/shiboken6/libshiboken/pep384impl.h +++ b/sources/shiboken6/libshiboken/pep384impl.h @@ -225,9 +225,6 @@ LIBSHIBOKEN_API void PepException_SetArgs(PyObject *ex, PyObject *args); // needed a debug Python. // -// PyUnicode_GetSize is deprecated in favor of PyUnicode_GetLength. -#define PepUnicode_GetLength(op) PyUnicode_GetLength((PyObject *)(op)) - // Unfortunately, we cannot ask this at runtime // #if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 >= 0x030A0000 // FIXME: Python 3.10: Replace _PepUnicode_AsString by PyUnicode_AsUTF8 diff --git a/sources/shiboken6/libshiboken/sbkpython.h b/sources/shiboken6/libshiboken/sbkpython.h index 88e1e6f82..4914bec4d 100644 --- a/sources/shiboken6/libshiboken/sbkpython.h +++ b/sources/shiboken6/libshiboken/sbkpython.h @@ -15,26 +15,11 @@ #if defined(slots) && (defined(__GNUC__) || defined(_MSC_VER) || defined(__clang__)) # pragma push_macro("slots") # undef slots -/* - * Python 2 has function _Py_Mangle directly in Python.h . - * This creates wrong language binding unless we define 'extern "C"' here. - */ -extern "C" { -/* - * Python 2 uses the "register" keyword, which is deprecated in C++ 11 - * and forbidden in C++17. - */ -# if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-register" -# endif +extern "C" { # include <Python.h> - -# if defined(__clang__) -# pragma clang diagnostic pop -# endif } + # include <structmember.h> // Now we have the usual variables from Python.h . # include "shibokenmacros.h" @@ -45,21 +30,9 @@ extern "C" { #else extern "C" { -/* - * Python 2 uses the "register" keyword, which is deprecated in C++ 11 - * and forbidden in C++17. - */ -# if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wdeprecated-register" -# endif - # include <Python.h> - -# if defined(__clang__) -# pragma clang diagnostic pop -# endif } + # include <structmember.h> // Now we have the usual variables from Python.h . # include "shibokenmacros.h" diff --git a/sources/shiboken6/libshiboken/sbkstring.cpp b/sources/shiboken6/libshiboken/sbkstring.cpp index b5e87ca5a..f8d460f5d 100644 --- a/sources/shiboken6/libshiboken/sbkstring.cpp +++ b/sources/shiboken6/libshiboken/sbkstring.cpp @@ -152,7 +152,7 @@ Py_ssize_t len(PyObject *str) return 0; if (PyUnicode_Check(str)) - return PepUnicode_GetLength(str); + return PyUnicode_GetLength(str); if (PyBytes_Check(str)) return PyBytes_GET_SIZE(str); diff --git a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py index edaaddbac..453bd2471 100644 --- a/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py +++ b/sources/shiboken6/shibokenmodule/files.dir/shibokensupport/signature/lib/enum_sig.py @@ -311,7 +311,7 @@ class SimplifyingEnumerator(ExactEnumerator): ret = self.result_type() signature = get_sig(func, 'existence') sig = stringify(signature) if signature is not None else None - if sig is not None and func_name not in ("next", "__next__", "__div__"): + if sig is not None: with self.fmt.function(func_name, sig) as key: ret[key] = sig return ret |
