path: root/sources/shiboken2
diff options
authorChristian Tismer <tismer@stackless.com>2018-07-08 18:40:33 +0200
committerChristian Tismer <tismer@stackless.com>2018-07-09 15:34:00 +0000
commit55d89709967354e606313a6078f580c8073a6dd8 (patch)
treec0c9419093bea05230590739031235b14f62126a /sources/shiboken2
parent5662706937bd6a1449538539e3a503c6cbc45399 (diff)
Fix Limited API and Signature Glitches in Python 3.7
When the homebrew version of Python 3.7 appeared so unforeseen early, I felt inclined to fix these glitches, immediately: In Python 3.7, the typing module was more changed than expected. Since we don't support versions below 3.5, it was easy to fix by avoiding to copy typing.py for version 3.x, altogether. It stays there for Python 2.7 . Furthermore, the Python issue 33738 will later be solved than the code expected, so I fixed that one for all by a macro definition. Task-number: PYSIDE-741 Change-Id: Ia56ccd1ef20cb9536b1d39f190e011e5dccf1f22 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2')
2 files changed, 4 insertions, 5 deletions
diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp
index dcd844ed..f0e8f345 100644
--- a/sources/shiboken2/libshiboken/pep384impl.cpp
+++ b/sources/shiboken2/libshiboken/pep384impl.cpp
@@ -449,7 +449,7 @@ check_PepTypeObject_valid(void)
-#if PY_VERSION_HEX < 0x03070000
#include "pep384_issue33738.cpp"
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index bfc603f6..d5b0c765 100644
--- a/sources/shiboken2/libshiboken/pep384impl.h
+++ b/sources/shiboken2/libshiboken/pep384impl.h
@@ -134,10 +134,9 @@ typedef struct _peptypeobject {
} PepTypeObject;
// 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
+// It was fixed in Python master, but did make it only in Python 3.8 .
+#define PY_ISSUE33738_SOLVED 0x03080000
#undef PyIndex_Check
LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);