def getValue(self, key, interp=True): res_p = KeyVal_C_API.new_char_ptr_ptr() errcode = KeyVal_C_API.KeyVal_getValue(res_p, self.kv, key, interp) if errcode: raise Exception("[ERROR] KeyVal.getValue") res = KeyVal_C_API.char_ptr_ptr_value(res_p) KeyVal_C_API.delete_char_ptr_ptr(res_p) # free up the C's returned value: KeyVal_C_API.KeyVal_dtltyjr() return res