]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
downloader: Fetch __version__ from C module
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Apr 2022 20:44:29 +0000 (20:44 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Apr 2022 20:44:29 +0000 (20:44 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/location/downloader.py
src/python/locationmodule.c

index 05f7872d1ff59b409c5c961e7362882c7d911888..b9e0c22ca9c4a80908c3a89d16b6e6f2834f4107 100644 (file)
@@ -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 = (
index 15f661b05e1f633ab18ab28fba52d80650eb6c16..09cd5dde06d5783c994d7f424e2961fc1df55365 100644 (file)
@@ -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;