public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/ldns] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
@ 2026-08-11 8:01 Jitka Plesnikova
0 siblings, 0 replies; only message in thread
From: Jitka Plesnikova @ 2026-08-11 8:01 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/ldns
Branch : rawhide
Commit : 7aa3fd2d7a1b3b57cf837303979dfaa016cfef47
Author : Jitka Plesnikova <jplesnik@redhat.com>
Date : 2026-07-28T15:29:18+02:00
Stats : +25/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/ldns/c/7aa3fd2d7a1b3b57cf837303979dfaa016cfef47?branch=rawhide
Log:
Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility
---
diff --git a/ldns-swig45.patch b/ldns-swig45.patch
new file mode 100644
index 0000000..1e5e983
--- /dev/null
+++ b/ldns-swig45.patch
@@ -0,0 +1,21 @@
+diff -up ldns-1.9.2/contrib/python/ldns.i.swig45 ldns-1.9.2/contrib/python/ldns.i
+--- ldns-1.9.2/contrib/python/ldns.i.swig45 2026-07-28 12:30:04.741529232 +0200
++++ ldns-1.9.2/contrib/python/ldns.i 2026-07-28 12:33:31.997732285 +0200
+@@ -151,7 +151,7 @@ int Python_str_Check(PyObject *o) {
+ #if PY_VERSION_HEX>=0x03000000
+ return PyUnicode_Check(o);
+ #else
+- return PyString_Check(o);
++ return PyBytes_Check(o);
+ #endif
+ }
+ %}
+@@ -414,7 +414,7 @@ PyObject* ldns_pkt2wire_(const ldns_pkt
+ tuple = PyTuple_New(2);
+ PyTuple_SetItem(tuple, 0, SWIG_From_int(result));
+ if (result == LDNS_STATUS_OK)
+- PyTuple_SetItem(tuple, 1, SWIG_FromCharPtrAndSize((char *)arg1, arg3));
++ PyTuple_SetItem(tuple, 1, PyUnicode_FromStringAndSize((char *)arg1, arg3));
+ else {
+ Py_INCREF(Py_None);
+ PyTuple_SetItem(tuple, 1, Py_None);
diff --git a/ldns.spec b/ldns.spec
index e722d25..63d67df 100644
--- a/ldns.spec
+++ b/ldns.spec
@@ -44,6 +44,10 @@ Patch1: ldns-1.7.0-multilib.patch
# https://github.com/NLnetLabs/ldns/pull/288
Patch8: ldns-1.9-std23-bool.patch
+# Replace removed Python 2 C API macros with Python 3 equivalents
+# for compatibility with SWIG 4.5.0
+Patch9: ldns-swig45.patch
+
BuildRequires: libtool
BuildRequires: autoconf
BuildRequires: automake
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-11 8:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11 8:01 [rpms/ldns] rawhide: Replace removed Python 2 C API macros for SWIG 4.5.0 compatibility Jitka Plesnikova
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox