From: Michael Tremer Date: Thu, 14 Apr 2022 20:44:29 +0000 (+0000) Subject: downloader: Fetch __version__ from C module X-Git-Tag: 0.9.14~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5653ad7185c82799a399b151c8625ce9be973fb4;p=people%2Fms%2Flibloc.git downloader: Fetch __version__ from C module Signed-off-by: Michael Tremer --- diff --git a/src/python/location/downloader.py b/src/python/location/downloader.py index 05f7872..b9e0c22 100644 --- a/src/python/location/downloader.py +++ b/src/python/location/downloader.py @@ -28,8 +28,7 @@ import urllib.error import urllib.parse import urllib.request -from . import __version__ -from _location import Database, DATABASE_VERSION_LATEST +from _location import Database, DATABASE_VERSION_LATEST, __version__ DATABASE_FILENAME = "location.db.xz" MIRRORS = ( diff --git a/src/python/locationmodule.c b/src/python/locationmodule.c index 15f661b..09cd5dd 100644 --- a/src/python/locationmodule.c +++ b/src/python/locationmodule.c @@ -117,6 +117,10 @@ PyMODINIT_FUNC PyInit__location(void) { if (!m) return NULL; + // Version + if (PyModule_AddStringConstant(m, "__version__", PACKAGE_VERSION)) + return NULL; + // AS if (PyType_Ready(&ASType) < 0) return NULL;