]> git.ipfire.org Git - people/ms/pakfire.git/commitdiff
_pakfire: Correctly handle it no configuration was given
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 15 Sep 2023 15:47:29 +0000 (15:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 17 Sep 2023 13:00:29 +0000 (13:00 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/_pakfire/pakfire.c

index b239c073836d3e7a5971cd5e651f41efa0a0e4d2..ce16c3c3925b5c17f13e3a859b2f47ced3c29510 100644 (file)
@@ -193,7 +193,7 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
        };
        const char* path = NULL;
        const char* arch = NULL;
-       PyObject* conf = NULL;
+       PyObject* conf = Py_None;
        int offline = 0;
        int r = 1;
 
@@ -216,7 +216,7 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) {
        }
 
        // Map the configuration
-       if (conf) {
+       if (conf != Py_None) {
                fconf = PyObject_AsFileHandle(conf, "r");
                if (!fconf)
                        goto ERROR;