File ustreamer-python3.9-compat.patch of Package ustreamer
From dce55a26ed2f424ca87881f229bc2dedee67ec09 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Sun, 16 Mar 2025 22:34:46 +0000
Subject: [PATCH] Make Python module work with Python 3.9.
Avoid using PyModule_AddObjectRef because() it's available starting with
Python 3.10. Use PyModule_AddObject() instead.
This is needed for RHEL 9 that has Python 3.9 by default as well as many
packages built for Python 3.9 that are necessary for KVMD.
Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
python/src/ustreamer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/python/src/ustreamer.c b/python/src/ustreamer.c
index c4bb8ed..e92c36a 100644
--- a/python/src/ustreamer.c
+++ b/python/src/ustreamer.c
@@ -326,7 +326,8 @@ PyMODINIT_FUNC PyInit_ustreamer(void) {
ADD(IntConstant, "VERSION_MAJOR", US_VERSION_MAJOR);
ADD(IntConstant, "VERSION_MINOR", US_VERSION_MINOR);
ADD(StringConstant, "FEATURES", US_FEATURES); // Defined in setup.py
- ADD(ObjectRef, "Memsink", (PyObject*)&_MemsinkType);
+ Py_INCREF(&_MemsinkType);
+ ADD(Object, "Memsink", (PyObject*)&_MemsinkType);
# undef ADD
return module;
--
2.48.1