Replace deprecated PyEval_CallObject() (RHBZ#2245816)

Patch sent upstream.
epel9
Sandro 10 months ago
parent c866459e55
commit 15686e9f2f
No known key found for this signature in database
GPG Key ID: 68D0FF74FE9F382A

@ -0,0 +1,40 @@
From 37a7a2e60e310056553a39d1fd9a9fda6e565e7b Mon Sep 17 00:00:00 2001
From: Sandro <devel@penguinpee.nl>
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,

@ -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

Loading…
Cancel
Save