diff options
| author | Damien George | 2020-03-18 17:26:19 +1100 |
|---|---|---|
| committer | Damien George | 2020-03-18 17:26:19 +1100 |
| commit | ad9a0ec8abc9d04b93b949831b7152f55ca0d7ac (patch) | |
| tree | f988445bbb8f1ef36b1ae69bfa6e60f4ed5d3d4e /ports/nrf | |
| parent | 8f0778b2092a4af1b7109b997a3c9c14766e31e8 (diff) | |
all: Convert exceptions to use mp_raise_XXX helpers in remaining places.
Diffstat (limited to 'ports/nrf')
| -rw-r--r-- | ports/nrf/boards/microbit/modules/microbitimage.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ports/nrf/boards/microbit/modules/microbitimage.c b/ports/nrf/boards/microbit/modules/microbitimage.c index ce4a959f0..cc4719a3d 100644 --- a/ports/nrf/boards/microbit/modules/microbitimage.c +++ b/ports/nrf/boards/microbit/modules/microbitimage.c @@ -227,7 +227,7 @@ STATIC mp_obj_t microbit_image_make_new(const mp_obj_type_t *type_in, mp_uint_t return image_from_parsed_str(str, len); } } else { - mp_raise_msg(&mp_type_TypeError, "Image(s) takes a string."); + mp_raise_TypeError("Image(s) takes a string."); } } @@ -258,7 +258,7 @@ STATIC mp_obj_t microbit_image_make_new(const mp_obj_type_t *type_in, mp_uint_t } default: { - mp_raise_msg(&mp_type_TypeError, "Image() takes 0 to 3 arguments"); + mp_raise_TypeError("Image() takes 0 to 3 arguments"); } } } @@ -363,7 +363,7 @@ MP_DEFINE_CONST_FUN_OBJ_3(microbit_image_get_pixel_obj, microbit_image_get_pixel /* Raise an exception if not mutable */ static void check_mutability(microbit_image_obj_t *self) { if (self->base.five) { - mp_raise_msg(&mp_type_TypeError, "image cannot be modified (try copying first)"); + mp_raise_TypeError("image cannot be modified (try copying first)"); } } @@ -406,10 +406,10 @@ mp_obj_t microbit_image_blit(mp_uint_t n_args, const mp_obj_t *args) { mp_obj_t src = args[1]; if (mp_obj_get_type(src) != µbit_image_type) { - mp_raise_msg(&mp_type_TypeError, "expecting an image"); + mp_raise_TypeError("expecting an image"); } if (n_args == 7) { - mp_raise_msg(&mp_type_TypeError, "must specify both offsets"); + mp_raise_TypeError("must specify both offsets"); } mp_int_t x = mp_obj_get_int(args[2]); mp_int_t y = mp_obj_get_int(args[3]); |
