aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken2/libshiboken
diff options
context:
space:
mode:
Diffstat (limited to 'sources/shiboken2/libshiboken')
-rw-r--r--sources/shiboken2/libshiboken/basewrapper.cpp4
-rw-r--r--sources/shiboken2/libshiboken/bufferprocs27.h25
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.cpp2
-rw-r--r--sources/shiboken2/libshiboken/pep384impl.h84
-rw-r--r--sources/shiboken2/libshiboken/qt_attribution.json4
-rw-r--r--sources/shiboken2/libshiboken/sbkenum.cpp4
6 files changed, 27 insertions, 96 deletions
diff --git a/sources/shiboken2/libshiboken/basewrapper.cpp b/sources/shiboken2/libshiboken/basewrapper.cpp
index ae6b2a68a..122e60e41 100644
--- a/sources/shiboken2/libshiboken/basewrapper.cpp
+++ b/sources/shiboken2/libshiboken/basewrapper.cpp
@@ -259,7 +259,9 @@ void SbkObjectTypeDealloc(PyObject* pyObj)
PyTypeObject *type = reinterpret_cast<PyTypeObject*>(pyObj);
PyObject_GC_UnTrack(pyObj);
+#ifndef Py_LIMITED_API
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+#endif
if (sotp) {
if (sotp->user_data && sotp->d_func) {
sotp->d_func(sotp->user_data);
@@ -272,7 +274,9 @@ void SbkObjectTypeDealloc(PyObject* pyObj)
delete sotp;
sotp = nullptr;
}
+#ifndef Py_LIMITED_API
Py_TRASHCAN_SAFE_END(pyObj);
+#endif
}
PyObject* SbkObjectTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds)
diff --git a/sources/shiboken2/libshiboken/bufferprocs27.h b/sources/shiboken2/libshiboken/bufferprocs27.h
index 83c4a4750..6fc7a3ece 100644
--- a/sources/shiboken2/libshiboken/bufferprocs27.h
+++ b/sources/shiboken2/libshiboken/bufferprocs27.h
@@ -38,35 +38,36 @@
****************************************************************************/
/*
-PSF LICENSE AGREEMENT FOR PYTHON 3.6.5¶
+PSF LICENSE AGREEMENT FOR PYTHON 3.7.0
+
1. This LICENSE AGREEMENT is between the Python Software Foundation ("PSF"), and
the Individual or Organization ("Licensee") accessing and otherwise using Python
- 3.6.2 software in source or binary form and its associated documentation.
+ 3.7.0 software in source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
- distribute, and otherwise use Python 3.6.2 alone or in any derivative
+ distribute, and otherwise use Python 3.7.0 alone or in any derivative
version, provided, however, that PSF's License Agreement and PSF's notice of
- copyright, i.e., "Copyright © 2001-2017 Python Software Foundation; All Rights
- Reserved" are retained in Python 3.6.2 alone or in any derivative version
+ copyright, i.e., "Copyright © 2001-2018 Python Software Foundation; All Rights
+ Reserved" are retained in Python 3.7.0 alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on or
- incorporates Python 3.6.2 or any part thereof, and wants to make the
+ incorporates Python 3.7.0 or any part thereof, and wants to make the
derivative work available to others as provided herein, then Licensee hereby
agrees to include in any such work a brief summary of the changes made to Python
- 3.6.2.
+ 3.7.0.
-4. PSF is making Python 3.6.2 available to Licensee on an "AS IS" basis.
+4. PSF is making Python 3.7.0 available to Licensee on an "AS IS" basis.
PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF
EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND DISCLAIMS ANY REPRESENTATION OR
WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE
- USE OF PYTHON 3.6.2 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
+ USE OF PYTHON 3.7.0 WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
-5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.6.2
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON 3.7.0
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF
- MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.6.2, OR ANY DERIVATIVE
+ MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 3.7.0, OR ANY DERIVATIVE
THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material breach of
@@ -78,7 +79,7 @@ PSF LICENSE AGREEMENT FOR PYTHON 3.6.5¶
trademark sense to endorse or promote products or services of Licensee, or any
third party.
-8. By copying, installing or otherwise using Python 3.6.2, Licensee agrees
+8. By copying, installing or otherwise using Python 3.7.0, Licensee agrees
to be bound by the terms and conditions of this License Agreement.
*/
diff --git a/sources/shiboken2/libshiboken/pep384impl.cpp b/sources/shiboken2/libshiboken/pep384impl.cpp
index dcd844ed6..f0e8f3457 100644
--- a/sources/shiboken2/libshiboken/pep384impl.cpp
+++ b/sources/shiboken2/libshiboken/pep384impl.cpp
@@ -449,7 +449,7 @@ check_PepTypeObject_valid(void)
#ifdef Py_LIMITED_API
-#if PY_VERSION_HEX < 0x03070000
+#if PY_VERSION_HEX < PY_ISSUE33738_SOLVED
#include "pep384_issue33738.cpp"
#endif
diff --git a/sources/shiboken2/libshiboken/pep384impl.h b/sources/shiboken2/libshiboken/pep384impl.h
index bfc603f69..8f14c853a 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
+#if PY_VERSION_HEX < PY_ISSUE33738_SOLVED
#undef PyIndex_Check
LIBSHIBOKEN_API int PyIndex_Check(PyObject *obj);
#endif
@@ -289,83 +288,6 @@ typedef struct _methoddescr PyMethodDescrObject;
/*****************************************************************************
*
- * RESOLVED: pystate.h
- *
- */
-
-/*
- * pystate provides the data structure that is needed for the trashcan
- * algorithm. Unfortunately, it is not included in the limited API.
- * We have two options:
- *
- * (1) ignore trashcan and live without secured deeply nested structures,
- * (2) maintain the structure ourselves and make sure it does not change.
- *
- * I have chosen the second option.
- *
- * When a new python version appears, you need to check compatibility of
- * the PyThreadState structure (pystate.h) and the trashcan macros at the
- * end of object.h .
- */
-
-#ifdef Py_LIMITED_API
-
-#define Py_TRASH_MIN_COMPATIBLE 0x03020400
-#define Py_TRASH_MAX_COMPATIBLE 0x0307FFFF
-
-#if PY_VERSION_HEX >= Py_TRASH_MIN_COMPATIBLE && \
- PY_VERSION_HEX <= Py_TRASH_MAX_COMPATIBLE
-typedef int (*Py_tracefunc)(PyObject *, struct _frame *, int, PyObject *);
-
-// This structure has the trashcan variables since Python 3.2.4.
-// We renamed all but the trashcan fields to make sure that we don't use
-// anything else somewhere.
-
-typedef struct _ts {
- struct _ts *Pep_prev;
- struct _ts *Pep_next;
- PyInterpreterState *Pep_interp;
-
- struct _frame *Pep_frame;
- int Pep_recursion_depth;
- char Pep_overflowed;
- char Pep_recursion_critical;
-
- int Pep_tracing;
- int Pep_use_tracing;
-
- Py_tracefunc Pep_c_profilefunc;
- Py_tracefunc Pep_c_tracefunc;
- PyObject *Pep_c_profileobj;
- PyObject *Pep_c_traceobj;
-
- PyObject *Pep_curexc_type;
- PyObject *Pep_curexc_value;
- PyObject *Pep_curexc_traceback;
-
- PyObject *Pep_exc_type;
- PyObject *Pep_exc_value;
- PyObject *Pep_exc_traceback;
-
- PyObject *Pep_dict;
-
- int Pep_gilstate_counter;
-
- PyObject *Pep_async_exc;
- long Pep_thread_id;
- // These two variables only are of interest to us.
- int trash_delete_nesting;
- PyObject *trash_delete_later;
- // Here we cut away the rest of the reduced structure.
-} PyThreadState;
-#else
-#error *** Please check compatibility of the trashcan code, see Pep.h ***
-#endif
-
-#endif // Py_LIMITED_API
-
-/*****************************************************************************
- *
* RESOLVED: pythonrun.h
*
*/
diff --git a/sources/shiboken2/libshiboken/qt_attribution.json b/sources/shiboken2/libshiboken/qt_attribution.json
index a90cc604b..14695a4d2 100644
--- a/sources/shiboken2/libshiboken/qt_attribution.json
+++ b/sources/shiboken2/libshiboken/qt_attribution.json
@@ -5,8 +5,8 @@
"QtUsage": "Used for Qt for Python in the signature extension.",
"Description": "Qt for Python is an add-on for Python. The libshiboken packages of PySide uses certain parts of the source files (typespec.cpp, typespec.h, bufferprocs27.cpp, bufferprocs27.h). See the folder sources/shiboken2/libshiboken .",
"Homepage": "http://www.python.org/",
- "Version": "3.6.5",
- "License": "PSF LICENSE AGREEMENT FOR PYTHON 3.6.5",
+ "Version": "3.7.0",
+ "License": "PSF LICENSE AGREEMENT FOR PYTHON 3.7.0",
"LicenseFile": "bufferprocs27.h",
"Copyright": "© Copyright 2001-2018, Python Software Foundation."
}
diff --git a/sources/shiboken2/libshiboken/sbkenum.cpp b/sources/shiboken2/libshiboken/sbkenum.cpp
index 5f753293c..119591215 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);
PyObject_GC_UnTrack(pyObj);
+#ifndef Py_LIMITED_API
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+#endif
if (PepType_SETP(sbkType)->converter) {
Shiboken::Conversions::deleteConverter(PepType_SETP(sbkType)->converter);
}
+#ifndef Py_LIMITED_API
Py_TRASHCAN_SAFE_END(pyObj);
+#endif
}
PyObject* SbkEnumTypeTpNew(PyTypeObject* metatype, PyObject* args, PyObject* kwds)