diff --git a/python/obitools3/obidms/_obidmscolumn_qual.pyx b/python/obitools3/obidms/_obidmscolumn_qual.pyx index 00d82ab..f8c4635 100644 --- a/python/obitools3/obidms/_obidmscolumn_qual.pyx +++ b/python/obitools3/obidms/_obidmscolumn_qual.pyx @@ -70,11 +70,16 @@ cdef class OBIDMS_column_qual(OBIDMS_column): free(value_b) cpdef set_str_line(self, index_t line_nb, object value): + cdef bytes value_b if value is None : if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self.view.pointer, (self.pointer)[0], line_nb, 0, OBIQual_char_NA) < 0: raise Exception("Problem setting a value in a column") else : - if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self.view.pointer, (self.pointer)[0], line_nb, 0, str2bytes(value)) < 0: + if type(value) == str: + value_b = str2bytes(value) + else : + value_b = value + if obi_set_qual_char_with_elt_idx_and_col_p_in_view(self.view.pointer, (self.pointer)[0], line_nb, 0, value_b) < 0: raise Exception("Problem setting a value in a column")