@@ -386,7 +386,7 @@ static mp_obj_t mp_ctx_texture(size_t n_args, const mp_obj_t *args) {
386386 mp_ctx_obj_t * self = MP_OBJ_TO_PTR (args [0 ]);
387387
388388 if (!mp_get_buffer (args [1 ], & buffer_info , MP_BUFFER_READ )) {
389- mp_raise_TypeError ("not a buffer" );
389+ mp_raise_TypeError (MP_ERROR_TEXT ( "not a buffer" ) );
390390 }
391391 int format = mp_obj_get_int (args [2 ]);
392392 int width = mp_obj_get_int (args [3 ]);
@@ -444,7 +444,7 @@ static mp_obj_t mp_ctx_get_font_name(mp_obj_t self_in, mp_obj_t no_in) {
444444 if (name )
445445 return mp_obj_new_str (name , strlen (name ));
446446 else
447- mp_raise_ValueError ("font with given index does not exist" );
447+ mp_raise_ValueError (MP_ERROR_TEXT ( "font with given index does not exist" ) );
448448}
449449MP_DEFINE_CONST_FUN_OBJ_2 (mp_ctx_get_font_name_obj , mp_ctx_get_font_name );
450450
@@ -466,12 +466,12 @@ static mp_obj_t mp_ctx_add_stop(size_t n_args, const mp_obj_t *args) {
466466 alpha_f = (float )mp_obj_get_float (args [3 ]);
467467 }
468468 if (alpha_f < 0.0f || alpha_f > 1.0f ) {
469- mp_raise_ValueError ("alpha must be between 0.0 or 1.0" );
469+ mp_raise_ValueError (MP_ERROR_TEXT ( "alpha must be between 0.0 or 1.0" ) );
470470 }
471471
472472 mp_obj_t red_in , green_in , blue_in ;
473473 if (mp_obj_get_int (mp_obj_len (color_in )) < 3 ) {
474- mp_raise_ValueError ("color must have 3 elements" );
474+ mp_raise_ValueError (MP_ERROR_TEXT ( "color must have 3 elements" ) );
475475 }
476476 red_in = mp_obj_subscr (color_in , mp_obj_new_int (0 ), MP_OBJ_SENTINEL );
477477 green_in = mp_obj_subscr (color_in , mp_obj_new_int (1 ), MP_OBJ_SENTINEL );
@@ -647,7 +647,7 @@ static mp_obj_t mp_ctx_make_new(const mp_obj_type_t *type, size_t n_args,
647647
648648 if (!mp_get_buffer (args [ARG_buffer ].u_obj , & buffer_info ,
649649 MP_BUFFER_READ )) {
650- mp_raise_TypeError ("not a buffer" );
650+ mp_raise_TypeError (MP_ERROR_TEXT ( "not a buffer" ) );
651651 }
652652 o -> ctx = ctx_new_for_framebuffer (buffer_info .buf , width , height , stride ,
653653 format );
0 commit comments