Commit f35adb4c authored by Michael Tremer's avatar Michael Tremer

python: database: Return None if no description/vendor/license set

Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 671e149e
......@@ -103,18 +103,24 @@ static PyObject* Database_verify(DatabaseObject* self, PyObject* args) {
static PyObject* Database_get_description(DatabaseObject* self) {
const char* description = loc_database_get_description(self->db);
if (!description)
Py_RETURN_NONE;
return PyUnicode_FromString(description);
}
static PyObject* Database_get_vendor(DatabaseObject* self) {
const char* vendor = loc_database_get_vendor(self->db);
if (!vendor)
Py_RETURN_NONE;
return PyUnicode_FromString(vendor);
}
static PyObject* Database_get_license(DatabaseObject* self) {
const char* license = loc_database_get_license(self->db);
if (!license)
Py_RETURN_NONE;
return PyUnicode_FromString(license);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment