]> git.ipfire.org Git - pakfire.git/commitdiff
python: Fail with a more simple return value
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 15:43:17 +0000 (15:43 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 27 Jan 2025 15:43:17 +0000 (15:43 +0000)
There is no way to extrapolate why the function call has failed but
reading the log.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/pakfire.c

index 007a1c08b821cdc8b72b21f7cf1159708c50fba9..907ff14592f32d70e9c30a8d881aab40432fe497 100644 (file)
@@ -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: