From: Michael Tremer Date: Mon, 27 Jan 2025 15:43:17 +0000 (+0000) Subject: python: Fail with a more simple return value X-Git-Tag: 0.9.30~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=222131e97b818864958f9c533e6855d40f43343a;p=pakfire.git python: Fail with a more simple return value There is no way to extrapolate why the function call has failed but reading the log. Signed-off-by: Michael Tremer --- diff --git a/src/python/pakfire.c b/src/python/pakfire.c index 007a1c08..907ff145 100644 --- a/src/python/pakfire.c +++ b/src/python/pakfire.c @@ -102,17 +102,8 @@ static int Pakfire_init(PakfireObject* self, PyObject* args, PyObject* kwds) { if (r < 0) { errno = -r; - switch (errno) { - // Invalid architecture or path - case EINVAL: - PyErr_SetString(PyExc_ValueError, "Invalid architecture or path"); - goto ERROR; - - // Anything else - default: - PyErr_SetFromErrno(PyExc_OSError); - goto ERROR; - } + PyErr_SetFromErrno(PyExc_OSError); + goto ERROR; } ERROR: