mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
systemd-python: fix initialization of _Reader objects
https://bugzilla.redhat.com/show_bug.cgi?id=995575
This commit is contained in:
parent
04bf3c1a60
commit
c2748ce28c
@ -64,6 +64,10 @@ static PyStructSequence_Desc Monotonic_desc = {
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Convert a Python sequence object into a strv (char**), and
|
||||
* None into a NULL pointer.
|
||||
*/
|
||||
static int strv_converter(PyObject* obj, void *_result) {
|
||||
char ***result = _result;
|
||||
Py_ssize_t i, len;
|
||||
@ -73,6 +77,11 @@ static int strv_converter(PyObject* obj, void *_result) {
|
||||
if (!obj)
|
||||
goto cleanup;
|
||||
|
||||
if (obj == Py_None) {
|
||||
*result = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!PySequence_Check(obj))
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user