nixpkgs/pkgs/by-name/ro/root5/python313-PyCFunction_Call.patch
2025-06-08 16:42:56 -04:00

14 lines
495 B
Diff

--- a/bindings/pyroot/src/TCustomPyTypes.cxx
+++ b/bindings/pyroot/src/TCustomPyTypes.cxx
@@ -240,7 +240,11 @@
// the function is globally shared, so set and reset its "self" (ok, b/c of GIL)
Py_INCREF( self );
func->m_self = self;
+#if PY_VERSION_HEX >= 0x03090000
+ PyObject* result = PyObject_Call( (PyObject*)func, args, kw );
+#else
PyObject* result = PyCFunction_Call( (PyObject*)func, args, kw );
+#endif
func->m_self = 0;
Py_DECREF( self );
Py_DECREF( args );