From 5e74c720a97041506b3ef3218483fed25bc781e5 Mon Sep 17 00:00:00 2001 From: Kai Huuhko Date: Tue, 16 Sep 2014 17:44:03 +0300 Subject: [PATCH] Eolian: Add nonzero function and remove useless warning from iterator --- efl/eolian/__init__.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/efl/eolian/__init__.pyx b/efl/eolian/__init__.pyx index 917bde3..7d0361c 100644 --- a/efl/eolian/__init__.pyx +++ b/efl/eolian/__init__.pyx @@ -141,6 +141,9 @@ cdef class EinaIterator(object): def __iter__(self): return self + + def __nonzero__(self): + return self.itr is not NULL def __next__(self): cdef: @@ -148,9 +151,6 @@ cdef class EinaIterator(object): bint itr_ret if self.itr is NULL: - EINA_LOG_DOM_WARN( - EOLIAN_DOM, "Iterator is NULL!", NULL - ) raise StopIteration itr_ret = eina_iterator_next(self.itr, &data) if not itr_ret: