From: Michael Tremer Date: Fri, 15 Sep 2023 15:47:29 +0000 (+0000) Subject: _pakfire: Correctly handle it no configuration was given X-Git-Tag: 0.9.30~1693 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b6bb64515486907e816b6a253d9faa963bf43cd;p=pakfire.git _pakfire: Correctly handle it no configuration was given Signed-off-by: Michael Tremer --- diff --git a/src/_pakfire/pakfire.c b/src/_pakfire/pakfire.c index b239c0738..ce16c3c39 100644 --- a/src/_pakfire/pakfire.c +++ b/src/_pakfire/pakfire.c @@ -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;