@_FFI.callback(u'Value(ExternContext*, uint8_t*, uint64_t)')
def extern_create_exception(context_handle, msg_ptr, msg_len):
 c = _FFI.from_handle(context_handle)
 msg = bytes(_FFI.buffer(msg_ptr, msg_len)).decode(u'utf-8')
 return c.to_value(Exception(msg))

@ _FFI . callback ( u'Value(ExternContext*, uint8_t*, uint64_t)' ) def extern_create_exception ( context_handle , msg_ptr , msg_len ) : c = _FFI . from_handle ( context_handle ) msg = bytes ( _FFI . buffer ( msg_ptr , msg_len ) ) . decode ( u'utf-8' ) return c . to_value ( Exception ( msg ) )
given a utf8 message string .