From c344a8a370afed66e78db88c2d129f6672dae1e6 Mon Sep 17 00:00:00 2001
From: Steve Grubb <sgrubb@redhat.com>
Date: Tue, 24 Oct 2023 11:51:04 -0400
Subject: [PATCH] Fix deprecated python function

---
 bindings/python/auparse_python.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/bindings/python/auparse_python.c b/bindings/python/auparse_python.c
index 78ef832c..1371ed54 100644
--- a/bindings/python/auparse_python.c
+++ b/bindings/python/auparse_python.c
@@ -290,7 +290,11 @@ static void auparse_callback(auparse_state_t *au,
     if (debug) printf("<< auparse_callback\n");
     arglist = Py_BuildValue("OiO", cb->py_AuParser, cb_event_type,
 			    cb->user_data);
+#if PY_MINOR_VERSION >= 13
+    result = PyObject_CallObject(cb->func, arglist);
+#else
     result = PyEval_CallObject(cb->func, arglist);
+#endif
     Py_DECREF(arglist);
     Py_XDECREF(result);
 }
-- 
2.27.0

