value returned for sequence is now bytes and no more str

This commit is contained in:
2016-05-29 13:53:32 +02:00
parent f830389974
commit 85395dfc1a

View File

@ -27,7 +27,7 @@ cdef class OBIDMS_column_seq(OBIDMS_column):
if strcmp(value, OBISeq_NA) == 0 :
result = None
else :
result = bytes2str(value)
result = <bytes> 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 = <bytes> 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 = <bytes> value
free(value)
result[self.elements_names[i]] = value_in_result
if all_NA and (value_in_result is not None) :