Skip to content

Commit 924c7aa

Browse files
committed
Use MP_ERROR_TEXT when raising exceptions
Seems like newer versions (1.13) require that.
1 parent 5393063 commit 924c7aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/stage/mod_stage.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,19 @@ STATIC mp_obj_t text_make_new(const mp_obj_type_t *type, size_t n_args,
184184
mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ);
185185
self->font = bufinfo.buf;
186186
if (bufinfo.len != 2048) {
187-
mp_raise_ValueError("font must be 2048 bytes long");
187+
mp_raise_ValueError(MP_ERROR_TEXT("font must be 2048 bytes long"));
188188
}
189189

190190
mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ);
191191
self->palette = bufinfo.buf;
192192
if (bufinfo.len != 32) {
193-
mp_raise_ValueError("palette must be 32 bytes long");
193+
mp_raise_ValueError(MP_ERROR_TEXT("palette must be 32 bytes long"));
194194
}
195195

196196
mp_get_buffer_raise(args[4], &bufinfo, MP_BUFFER_READ);
197197
self->chars = bufinfo.buf;
198198
if (bufinfo.len < self->width * self->height) {
199-
mp_raise_ValueError("chars buffer too small");
199+
mp_raise_ValueError(MP_ERROR_TEXT("chars buffer too small"));
200200
}
201201

202202
return MP_OBJ_FROM_PTR(self);
@@ -246,20 +246,20 @@ STATIC mp_obj_t layer_make_new(const mp_obj_type_t *type, size_t n_args,
246246
mp_get_buffer_raise(args[2], &bufinfo, MP_BUFFER_READ);
247247
self->graphic = bufinfo.buf;
248248
if (bufinfo.len != 2048) {
249-
mp_raise_ValueError("graphic must be 2048 bytes long");
249+
mp_raise_ValueError(MP_ERROR_TEXT("graphic must be 2048 bytes long"));
250250
}
251251

252252
mp_get_buffer_raise(args[3], &bufinfo, MP_BUFFER_READ);
253253
self->palette = bufinfo.buf;
254254
if (bufinfo.len != 32) {
255-
mp_raise_ValueError("palette must be 32 bytes long");
255+
mp_raise_ValueError(MP_ERROR_TEXT("palette must be 32 bytes long"));
256256
}
257257

258258
if (n_args > 4) {
259259
mp_get_buffer_raise(args[4], &bufinfo, MP_BUFFER_READ);
260260
self->map = bufinfo.buf;
261261
if (bufinfo.len < (self->width * self->height) / 2) {
262-
mp_raise_ValueError("map buffer too small");
262+
mp_raise_ValueError(MP_ERROR_TEXT("map buffer too small"));
263263
}
264264
} else {
265265
self-> map = NULL;
@@ -375,7 +375,7 @@ STATIC mp_obj_t stage_render(size_t n_args, const mp_obj_t *args) {
375375
// TODO: Make sure it's an SPI object.
376376
const mp_obj_type_t *type = mp_obj_get_type(spi);
377377
if (type->protocol == NULL) {
378-
mp_raise_ValueError("SPI protocol required");
378+
mp_raise_ValueError(MP_ERROR_TEXT("SPI protocol required"));
379379
}
380380
uint8_t scale = 1;
381381
if (n_args >= 8) {

0 commit comments

Comments
 (0)