From 15686e9f2f431abf6e4e6e192d908faf74bac21d Mon Sep 17 00:00:00 2001 From: Sandro Date: Fri, 19 Apr 2024 15:29:26 +0200 Subject: [PATCH] Replace deprecated PyEval_CallObject() (RHBZ#2245816) Patch sent upstream. --- 171.patch | 40 ++++++++++++++++++++++++++++++++++++++++ gdcm.spec | 4 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 171.patch diff --git a/171.patch b/171.patch new file mode 100644 index 0000000..1a858b8 --- /dev/null +++ b/171.patch @@ -0,0 +1,40 @@ +From 37a7a2e60e310056553a39d1fd9a9fda6e565e7b Mon Sep 17 00:00:00 2001 +From: Sandro +Date: Fri, 19 Apr 2024 15:18:43 +0200 +Subject: [PATCH] Python 3.13: Replace deprecated PyEval_CallObject() + +The function has been deprecated since Python 3.9 and will be removed +from Python 3.13. + +See: https://docs.python.org/3.13/whatsnew/3.13.html#id9 +--- + Wrapping/Python/gdcmswig.i | 2 +- + Wrapping/SWIGCommon/gdcmcommon.i | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Wrapping/Python/gdcmswig.i b/Wrapping/Python/gdcmswig.i +index a2aa3760db..820178b599 100644 +--- a/Wrapping/Python/gdcmswig.i ++++ b/Wrapping/Python/gdcmswig.i +@@ -623,7 +623,7 @@ static bool callback_helper(gdcm::DataSet const & ds1, gdcm::DataSet const & ds2 + /* fail */ + assert(0); + } +- result = PyEval_CallObject(func, arglist); ++ result = PyObject_CallObject(func, arglist); + Py_DECREF(arglist); + if (result && result != Py_None) { + PyErr_SetString(PyExc_TypeError, +diff --git a/Wrapping/SWIGCommon/gdcmcommon.i b/Wrapping/SWIGCommon/gdcmcommon.i +index 8794bce14c..449cf8c77a 100644 +--- a/Wrapping/SWIGCommon/gdcmcommon.i ++++ b/Wrapping/SWIGCommon/gdcmcommon.i +@@ -631,7 +631,7 @@ static bool callback_helper(gdcm::DataSet const & ds1, gdcm::DataSet const & ds2 + /* fail */ + assert(0); + } +- result = PyEval_CallObject(func, arglist); ++ result = PyObject_CallObject(func, arglist); + Py_DECREF(arglist); + if (result && result != Py_None) { + PyErr_SetString(PyExc_TypeError, diff --git a/gdcm.spec b/gdcm.spec index 0ae2791..15c8dc2 100644 --- a/gdcm.spec +++ b/gdcm.spec @@ -17,7 +17,9 @@ Source1: http://downloads.sourceforge.net/project/gdcm/gdcmData/gdcmData/gdcm Patch1: 0001-3.0.1-Use-copyright.patch # Fix for 1687233 -Patch3: 0002-Fix-export-variables.patch +Patch2: 0002-Fix-export-variables.patch +# Python 3.13: Replace deprecated PyEval_CallObject() +Patch3: https://github.com/malaterre/GDCM/pull/171.patch BuildRequires: CharLS-devel >= 2.0 BuildRequires: cmake