Skip to content
Snippets Groups Projects
Commit c3bfdf18 authored by Benjamin Kunz's avatar Benjamin Kunz
Browse files

use mp_get_buffer_raise

parent 76e06651
Branches
No related tags found
No related merge requests found
Pipeline #3680 passed
...@@ -100,11 +100,7 @@ static mp_obj_t mp_display_pixels(size_t n_args, const mp_obj_t *args) ...@@ -100,11 +100,7 @@ static mp_obj_t mp_display_pixels(size_t n_args, const mp_obj_t *args)
uint8_t offset_y = mp_obj_get_int(args[2]); uint8_t offset_y = mp_obj_get_int(args[2]);
mp_buffer_info_t bufinfo; mp_buffer_info_t bufinfo;
if (!mp_obj_is_str_or_bytes(args[0])) { mp_get_buffer_raise(args[0], &bufinfo, MP_BUFFER_READ);
mp_raise_TypeError("input must be a string or bytes");
}
mp_get_buffer(args[0], &bufinfo, MP_BUFFER_READ);
if(bufinfo.buf == NULL) { if(bufinfo.buf == NULL) {
return mp_const_none; return mp_const_none;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment