aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-06-09 13:59:42 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-06-10 13:24:57 +0000
commitdef30eba531b8474397b8ce27b268e2e18eb2422 (patch)
treea40e7efc072cd5e48fb8d09ccc81018356f1fe1c
parenta7d235ef9f255a7b848283ec2317867aa5c7357f (diff)
Fix deprecation of the Py_TRASHCAN_SAFE_BEGIN/END macros
Replace by Py_TRASHCAN_BEGIN/END as introduced in 3.10. Task-number: PYSIDE-1960 Change-Id: I17aaa2e9fa9c44f8c1004fc8dba8b22932ea44d0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> (cherry picked from commit 03928069a6781a1849245e6219f9caa64093068e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--sources/shiboken6/libshiboken/basewrapper.cpp8
-rw-r--r--sources/shiboken6/libshiboken/sbkenum.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/sources/shiboken6/libshiboken/basewrapper.cpp b/sources/shiboken6/libshiboken/basewrapper.cpp
index 068ad5142..b9d9b47ab 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -413,7 +413,11 @@ void SbkObjectType_tp_dealloc(PyTypeObject *sbkType)
PyObject_GC_UnTrack(pyObj);
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_BEGIN(pyObj, 1);
+# else
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+# endif
#endif
if (sotp) {
if (sotp->user_data && sotp->d_func) {
@@ -427,7 +431,11 @@ void SbkObjectType_tp_dealloc(PyTypeObject *sbkType)
PepType_SOTP_delete(sbkType);
}
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_END;
+# else
Py_TRASHCAN_SAFE_END(pyObj);
+# endif
#endif
if (PepRuntime_38_flag) {
// PYSIDE-939: Handling references correctly.
diff --git a/sources/shiboken6/libshiboken/sbkenum.cpp b/sources/shiboken6/libshiboken/sbkenum.cpp
index 58bd7894b..b9a320590 100644
--- a/sources/shiboken6/libshiboken/sbkenum.cpp
+++ b/sources/shiboken6/libshiboken/sbkenum.cpp
@@ -315,13 +315,21 @@ static void SbkEnumTypeDealloc(PyObject *pyObj)
PyObject_GC_UnTrack(pyObj);
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_BEGIN(pyObj, 1);
+# else
Py_TRASHCAN_SAFE_BEGIN(pyObj);
+# endif
#endif
if (setp->converter)
Conversions::deleteConverter(setp->converter);
PepType_SETP_delete(enumType);
#ifndef Py_LIMITED_API
+# if PY_VERSION_HEX >= 0x030A0000
+ Py_TRASHCAN_END;
+# else
Py_TRASHCAN_SAFE_END(pyObj);
+# endif
#endif
if (PepRuntime_38_flag) {
// PYSIDE-939: Handling references correctly.