Python module: avoid exception for 'for doc in q' where q is empty
This commit is contained in:
@@ -1075,7 +1075,7 @@ Query_iternext(PyObject *_self)
|
|||||||
}
|
}
|
||||||
int cnt = self->query->getResCnt();
|
int cnt = self->query->getResCnt();
|
||||||
if (cnt <= 0 || self->next < 0) {
|
if (cnt <= 0 || self->next < 0) {
|
||||||
PyErr_SetString(PyExc_AttributeError, "query: no results");
|
// This happens if there are no results and is not an error
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
recoll_DocObject *result =
|
recoll_DocObject *result =
|
||||||
|
|||||||
Reference in New Issue
Block a user