Skip to content

Commit 2b01c13

Browse files
committed
use a standard validator function
1 parent db01dfe commit 2b01c13

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

shared-bindings/adafruit_pixelbuf/PixelBuf.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,7 @@ STATIC mp_obj_t pixelbuf_pixelbuf_make_new(const mp_obj_type_t *type, size_t n_a
129129
}
130130

131131
static void parse_byteorder(mp_obj_t byteorder_obj, pixelbuf_byteorder_details_t *parsed) {
132-
if (!mp_obj_is_str(byteorder_obj)) {
133-
mp_raise_TypeError(translate("byteorder is not a string"));
134-
}
132+
mp_arg_validate_type_string(byteorder_obj, MP_QSTR_byteorder);
135133

136134
size_t bo_len;
137135
const char *byteorder = mp_obj_str_get_data(byteorder_obj, &bo_len);

0 commit comments

Comments
 (0)