diff --git a/python/obitools3/dms/taxo/taxo.pyx b/python/obitools3/dms/taxo/taxo.pyx index d473d91..314f49f 100755 --- a/python/obitools3/dms/taxo/taxo.pyx +++ b/python/obitools3/dms/taxo/taxo.pyx @@ -325,8 +325,9 @@ cdef class Taxonomy(OBIWrapper) : cdef Taxon taxon try: taxon = self.get_taxon_by_taxid(taxid) - except: - raise StopIteration + except Exception as e: + print('\n'+e, file=sys.stderr) + return if taxon is not None: while taxon.taxid != 1: yield taxon @@ -334,7 +335,7 @@ cdef class Taxonomy(OBIWrapper) : taxon = taxon.parent yield taxon else: - raise StopIteration + return def is_ancestor(self, int ancestor_taxid, int taxid):