aboutsummaryrefslogtreecommitdiffstats
path: root/sources
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2022-06-09 13:59:42 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2022-06-10 13:14:31 +0200
commit03928069a6781a1849245e6219f9caa64093068e (patch)
treeff49ede39919879644839370a62a7ccdd5621d8f /sources
parentad09e1b8e1ab7232023c05263c9cf377efc7d6c7 (diff)
Fix deprecation of the Py_TRASHCAN_SAFE_BEGIN/END macros
Replace by Py_TRASHCAN_BEGIN/END as introduced in 3.10. Pick-to: 6.3 6.2 5.15 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>
Diffstat (limited to 'sources')
-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 74df7fa31..d93f9b214 100644
--- a/sources/shiboken6/libshiboken/basewrapper.cpp
+++ b/sources/shiboken6/libshiboken/basewrapper.cpp
@@ -377,7 +377,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) {
@@ -391,7 +395,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 39fec0fa4..17abb43ce 100644
--- a/sources/shiboken6/libshiboken/sbkenum.cpp
+++ b/sources/shiboken6/libshiboken/sbkenum.cpp
@@ -279,13 +279,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.