From 99f99e8a56dff9dac67a3d24dec5320fb594f33e Mon Sep 17 00:00:00 2001 From: Robert Manner Date: Thu, 6 Feb 2020 16:33:25 +0100 Subject: [PATCH] plugins/python/sudo_python_module.c: fix options_as_dict if no equal sign The intented behaviour was that those get skipped, but the PyList_GetItem sets the interpreter into error state, so python has raised exception. --- plugins/python/sudo_python_module.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/python/sudo_python_module.c b/plugins/python/sudo_python_module.c index 456695af5..e33814720 100644 --- a/plugins/python/sudo_python_module.c +++ b/plugins/python/sudo_python_module.c @@ -171,6 +171,7 @@ python_sudo_options_as_dict(PyObject *py_self, PyObject *py_args) if (py_value == NULL) { // skip values without a key Py_CLEAR(py_config); Py_CLEAR(py_splitted); + PyErr_Clear(); continue; }