Skip to content

Commit 28b05ea

Browse files
committed
Use PyObject_CallNoArgs() where possible.
--HG-- branch : 1.9
1 parent 1143431 commit 28b05ea

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

plugins/python/python_loghandler.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323

2424
#include "sudo_python_module.h"
2525

26+
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION < 9
27+
# define PyObject_CallNoArgs(_o) PyObject_CallObject((_o), NULL)
28+
#endif
29+
2630
static PyObject *sudo_type_LogHandler;
2731

2832
static void
@@ -165,7 +169,7 @@ sudo_module_set_default_loghandler(void)
165169
PyObject *py_loghandler = NULL, *py_logging_module = NULL,
166170
*py_logger = NULL, *py_result = NULL;
167171

168-
py_loghandler = PyObject_CallObject(sudo_type_LogHandler, NULL);
172+
py_loghandler = PyObject_CallNoArgs(sudo_type_LogHandler);
169173
if (py_loghandler == NULL)
170174
goto cleanup;
171175

0 commit comments

Comments
 (0)