X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fpython-systemd%2F_daemon.c;h=d3b4807368aced0c0a07a825ab3851934fe8bc59;hb=5afbe712db5cc68213a24c45396ffb43fab05e3e;hp=8f93d91b48292e45a8af2e6b2a5587b39605db9a;hpb=b04c8c83e8d5670b0923c7cd7d6ea622b0187289;p=elogind.git diff --git a/src/python-systemd/_daemon.c b/src/python-systemd/_daemon.c index 8f93d91b4..d3b480736 100644 --- a/src/python-systemd/_daemon.c +++ b/src/python-systemd/_daemon.c @@ -244,7 +244,7 @@ static PyObject* is_socket_unix(PyObject *self, PyObject *args) { Py_ssize_t length = 0; #if PY_MAJOR_VERSION >=3 && PY_MINOR_VERSION >= 1 - PyObject _cleanup_Py_DECREF_ *_path = NULL; + _cleanup_Py_DECREF_ PyObject *_path = NULL; if (!PyArg_ParseTuple(args, "i|iiO&:_is_socket_unix", &fd, &type, &listening, Unicode_FSConverter, &_path)) return NULL; @@ -291,6 +291,7 @@ PyMODINIT_FUNC init_daemon(void) { return; PyModule_AddIntConstant(m, "LISTEN_FDS_START", SD_LISTEN_FDS_START); + PyModule_AddStringConstant(m, "__version__", PACKAGE_VERSION); } #else @@ -310,7 +311,8 @@ PyMODINIT_FUNC PyInit__daemon(void) { if (m == NULL) return NULL; - if (PyModule_AddIntConstant(m, "LISTEN_FDS_START", SD_LISTEN_FDS_START)) { + if (PyModule_AddIntConstant(m, "LISTEN_FDS_START", SD_LISTEN_FDS_START) || + PyModule_AddStringConstant(m, "__version__", PACKAGE_VERSION)) { Py_DECREF(m); return NULL; }