diff --git a/python/obitools3/dms/taxo/taxo.pyx b/python/obitools3/dms/taxo/taxo.pyx index 758b7ac..ec1cf21 100755 --- a/python/obitools3/dms/taxo/taxo.pyx +++ b/python/obitools3/dms/taxo/taxo.pyx @@ -113,7 +113,7 @@ cdef class Taxonomy(OBIWrapper) : raise NotImplementedError() - cpdef Taxon get_taxon_by_taxid(self, int taxid): # TODO check deleted taxon behavior (403122) + cpdef Taxon get_taxon_by_taxid(self, int taxid): cdef ecotx_t* taxon_p cdef object taxon_capsule taxon_p = obi_taxo_get_taxon_with_taxid(self.pointer(), taxid) @@ -256,13 +256,13 @@ cdef class Taxonomy(OBIWrapper) : cdef Taxon taxon try: taxon = self.get_taxon_by_taxid(taxid) - except: # TODO error handling (related to deleted taxon thing) + except: raise StopIteration if taxon is not None: - while taxon.parent.taxid != 1: # TODO was 0 before? + while taxon.taxid != 1: yield taxon taxon = taxon.parent - yield self[1] + yield taxon else: raise StopIteration