summaryrefslogtreecommitdiff
path: root/systemd/_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'systemd/_daemon.c')
-rw-r--r--systemd/_daemon.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/systemd/_daemon.c b/systemd/_daemon.c
index 0b56c7e..2d552a2 100644
--- a/systemd/_daemon.c
+++ b/systemd/_daemon.c
@@ -142,9 +142,12 @@ static PyObject* is_fifo(PyObject *self, PyObject *args) {
const char *path = NULL;
#if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 1
+ _cleanup_Py_DECREF_ PyObject *_path = NULL;
if (!PyArg_ParseTuple(args, "i|O&:_is_fifo",
- &fd, Unicode_FSConverter, &path))
+ &fd, Unicode_FSConverter, &_path))
return NULL;
+ if (_path)
+ path = PyBytes_AsString(_path);
#else
if (!PyArg_ParseTuple(args, "i|z:_is_fifo", &fd, &path))
return NULL;
@@ -170,9 +173,12 @@ static PyObject* is_mq(PyObject *self, PyObject *args) {
const char *path = NULL;
#if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 1
+ _cleanup_Py_DECREF_ PyObject *_path = NULL;
if (!PyArg_ParseTuple(args, "i|O&:_is_mq",
- &fd, Unicode_FSConverter, &path))
+ &fd, Unicode_FSConverter, &_path))
return NULL;
+ if (_path)
+ path = PyBytes_AsString(_path);
#else
if (!PyArg_ParseTuple(args, "i|z:_is_mq", &fd, &path))
return NULL;