From fe66ad214a94fa7f919d8535419cfb5311a00c8a Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Wed, 20 Feb 2019 18:32:56 +0100 Subject: [PATCH] Python module: avoid exception for 'for doc in q' where q is empty --- src/python/recoll/pyrecoll.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/python/recoll/pyrecoll.cpp b/src/python/recoll/pyrecoll.cpp index a47bbfab..288340d1 100644 --- a/src/python/recoll/pyrecoll.cpp +++ b/src/python/recoll/pyrecoll.cpp @@ -1075,7 +1075,7 @@ Query_iternext(PyObject *_self) } int cnt = self->query->getResCnt(); 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; } recoll_DocObject *result =