summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>1999-08-21 20:46:24 +0000
committerErik Troan <ewt@redhat.com>1999-08-21 20:46:24 +0000
commit5d9a06f08c553e4b88eeeaf2d9652ad5112cb87d (patch)
tree4126447211fe13d3a92dab0eab557a45e3c0240d
parent8ea71eedc808968dee39888fad6e835d17283f68 (diff)
downloadanaconda-5d9a06f08c553e4b88eeeaf2d9652ad5112cb87d.tar.gz
anaconda-5d9a06f08c553e4b88eeeaf2d9652ad5112cb87d.tar.xz
anaconda-5d9a06f08c553e4b88eeeaf2d9652ad5112cb87d.zip
return an empty list from findby*
-rw-r--r--rpmmodule/rpmmodule.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/rpmmodule/rpmmodule.c b/rpmmodule/rpmmodule.c
index 77df0fcb3..bf7dad2d6 100644
--- a/rpmmodule/rpmmodule.c
+++ b/rpmmodule/rpmmodule.c
@@ -598,16 +598,16 @@ static PyObject * handleDbResult(int rc, dbiIndexSet matches) {
if (rc == -1) {
PyErr_SetString(pyrpmError, "error reading from database");
return NULL;
- } else if (rc) {
- Py_INCREF(Py_None);
- return Py_None;
}
list = PyList_New(0);
- for (i = 0; i < matches.count; i++)
- PyList_Append(list, PyInt_FromLong(matches.recs[i].recOffset));
- dbiFreeIndexRecord(matches);
+ if (!rc) {
+ for (i = 0; i < matches.count; i++)
+ PyList_Append(list, PyInt_FromLong(matches.recs[i].recOffset));
+
+ dbiFreeIndexRecord(matches);
+ }
return list;
}