aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken/pep384impl.h
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2018-06-25 15:24:11 +0200
committerChristian Tismer <tismer@stackless.com>2018-06-26 07:39:34 +0000
commit4a32f9d00b043b7255b590b95e9b35e9de44c4ed (patch)
treeaa92fcc7b8f325c714b224995a3a2680ec9a5cec /sources/shiboken2/libshiboken/pep384impl.h
parent11c443016275093e4c713a3fbafdaea8967fca7c (diff)
Prepare Limited API for Python 3.7
PySide has successfully been tested with the Python 3.7 branch. There will be no change in the areas that are important for us. It is then safe to bump the supported version and the limited API version checks to fully include Python 3.7. The macro errors in the limited API was fixed by a pull request, but it was too late to get it into 3.7rc1. The error workaround was therefore extracted into pep384_issue33738.cpp and will be deactivated later. Change-Id: Iec3f277b02cac03a5cf44cbcf955ddc690c112e5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/pep384impl.h')
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index 69e98481..bfc603f6 100644
--- a/sources/shiboken2/libshiboken/pep384impl.h
+++ b/sources/shiboken2/libshiboken/pep384impl.h
@@ -133,11 +133,14 @@ typedef struct _peptypeobject {
} PepTypeObject;
-LIBSHIBOKEN_API unaryfunc PepType_nb_index(PyTypeObject *type);
-
+// This was a macro error in the limited API from the beginning.
+// It was fixed in Python 3.7 .
+// XXX The commit did go to master, but did not make it to 3.7, yet.
+//#if PY_VERSION_HEX < 0x03070000
+#if PY_VERSION_HEX < 0x03080000
#undef PyIndex_Check
-
LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);
+#endif
#undef PyObject_IS_GC
#define PyObject_IS_GC(o) (PyType_IS_GC(Py_TYPE(o)) && \
@@ -146,7 +149,6 @@ LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);
#else
#define PepTypeObject PyTypeObject
-#define PepType_nb_index(o) (PepType(o)->nb_index)
#endif // Py_LIMITED_API
struct SbkObjectTypePrivate;
@@ -309,7 +311,7 @@ typedef struct _methoddescr PyMethodDescrObject;
#ifdef Py_LIMITED_API
#define Py_TRASH_MIN_COMPATIBLE 0x03020400
-#define Py_TRASH_MAX_COMPATIBLE 0x030700A0
+#define Py_TRASH_MAX_COMPATIBLE 0x0307FFFF
#if PY_VERSION_HEX >= Py_TRASH_MIN_COMPATIBLE && \
PY_VERSION_HEX <= Py_TRASH_MAX_COMPATIBLE
@@ -383,7 +385,7 @@ LIBSHIBOKEN_API PyObject *PyRun_String(const char *, int, PyObject *, PyObject *
// But this is no problem as we check it's validity for every version.
#define PYTHON_BUFFER_VERSION_COMPATIBLE (PY_VERSION_HEX >= 0x03030000 && \
- PY_VERSION_HEX < 0X0306FFFF)
+ PY_VERSION_HEX < 0X0307FFFF)
#if !PYTHON_BUFFER_VERSION_COMPATIBLE
# error Please check the buffer compatibility for this python version!
#endif