summaryrefslogtreecommitdiff
path: root/src/python-systemd/_daemon.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/python-systemd/_daemon.c')
-rw-r--r--src/python-systemd/_daemon.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/python-systemd/_daemon.c b/src/python-systemd/_daemon.c
index ce2064935d..d3b4807368 100644
--- a/src/python-systemd/_daemon.c
+++ b/src/python-systemd/_daemon.c
@@ -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;
}