Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
// Create a new Pakfire instance
r = pakfire_create(&self->pakfire, self->ctx, c, path, arch, flags);
-
- Py_END_ALLOW_THREADS
-
if (r < 0) {
+ Py_BLOCK_THREADS
errno = -r;
PyErr_SetFromErrno(PyExc_OSError);
goto ERROR;
}
+ Py_END_ALLOW_THREADS
+
ERROR:
if (c)
pakfire_config_unref(c);
}
static void Pakfire_dealloc(PakfireObject* self) {
- if (self->pakfire) {
- Py_BEGIN_ALLOW_THREADS
+ Py_BEGIN_ALLOW_THREADS
+ if (self->pakfire)
pakfire_unref(self->pakfire);
-
- Py_END_ALLOW_THREADS
- }
if (self->ctx)
pakfire_ctx_unref(self->ctx);
+ Py_END_ALLOW_THREADS
+
Py_TYPE(self)->tp_free((PyObject *)self);
}