Eolian: Add nonzero function and remove useless warning from iterator

This commit is contained in:
Kai Huuhko 2014-09-16 17:44:03 +03:00
parent e46e109cab
commit 5e74c720a9
1 changed files with 3 additions and 3 deletions

View File

@ -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: