From 85395dfc1a0ec7e425f95933473595384770621a Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 29 May 2016 13:53:32 +0200 Subject: [PATCH] value returned for sequence is now bytes and no more str --- python/obitools3/obidms/_obidmscolumn_seq.pyx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/obitools3/obidms/_obidmscolumn_seq.pyx b/python/obitools3/obidms/_obidmscolumn_seq.pyx index 0819d82..7e96eb8 100644 --- a/python/obitools3/obidms/_obidmscolumn_seq.pyx +++ b/python/obitools3/obidms/_obidmscolumn_seq.pyx @@ -27,7 +27,7 @@ cdef class OBIDMS_column_seq(OBIDMS_column): if strcmp(value, OBISeq_NA) == 0 : result = None else : - result = bytes2str(value) + result = value free(value) return result @@ -64,10 +64,12 @@ cdef class OBIDMS_column_multi_elts_seq(OBIDMS_column_multi_elts): if strcmp(value, OBISeq_NA) == 0 : result = None else : - result = bytes2str(value) + result = value + # Be careful, we have to be sure that the cast copy the data in the python structure free(value) return result + cpdef object get_line(self, index_t line_nb) : cdef char* value cdef object value_in_result @@ -83,7 +85,7 @@ cdef class OBIDMS_column_multi_elts_seq(OBIDMS_column_multi_elts): if strcmp(value, OBISeq_NA) == 0 : value_in_result = None else : - value_in_result = bytes2str(value) + value_in_result = value free(value) result[self.elements_names[i]] = value_in_result if all_NA and (value_in_result is not None) :