path: root/sources/shiboken2/libshiboken/sbkenum.cpp
diff options
authorChristian Tismer <tismer@stackless.com>2018-07-10 12:27:15 +0200
committerChristian Tismer <tismer@stackless.com>2018-07-10 15:28:33 +0000
commit5829cbbf60529448e63e5b7103a007d08d9387d8 (patch)
treee7c38c04384ce3f1163172878d83a32f1b5bfb8a /sources/shiboken2/libshiboken/sbkenum.cpp
parent264e0ec580dcca0366aa0e79da11cf38893c4a2f (diff)
Fix limited API incompatibility with Python 3.7
When Python 3.7 appeared, the structure of pystate.h was changed, substantially. Unfortunately this structure contains the trashcan code, which is only available as a macro and not part of the limited API. This code is normally not used by application programs. It prevents crashes when chains of millions of objects are deallocated. I disabled this for now when the limited API is active. As soon as somebody complains about crashes, I will try to implement it again in a safe way, but I am not sure if it is worth it in the first place. Task-number: PYSIDE-737 Change-Id: Id0daf391448ddcb9df3d299f859ef024714fa736 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2/libshiboken/sbkenum.cpp')
1 files changed, 4 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp
index 5f753293..11959121 100644
--- a/sources/shiboken2/libshiboken/sbkenum.cpp
+++ b/sources/shiboken2/libshiboken/sbkenum.cpp
@@ -312,11 +312,15 @@ void SbkEnumTypeDealloc(PyObject* pyObj)
SbkEnumType* sbkType = reinterpret_cast<SbkEnumType*>(pyObj);
+#ifndef Py_LIMITED_API
if (PepType_SETP(sbkType)->converter) {
+#ifndef Py_LIMITED_API
PyObject* SbkEnumTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds)