Skip to content

Commit ffae89b

Browse files
committed
bitops: fix argument parsing
1 parent 72e8fb0 commit ffae89b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

shared-bindings/bitops/__init__.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
//| ...
5656

5757
STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
58-
enum { ARG_input, ARG_width, ARG_output };
58+
enum { ARG_input, ARG_output, ARG_width };
5959
static const mp_arg_t allowed_args[] = {
6060
{ MP_QSTR_input, MP_ARG_OBJ | MP_ARG_REQUIRED },
6161
{ MP_QSTR_output, MP_ARG_OBJ | MP_ARG_REQUIRED },
@@ -66,7 +66,7 @@ STATIC mp_obj_t bit_transpose(size_t n_args, const mp_obj_t *pos_args, mp_map_t
6666

6767
int width = args[ARG_width].u_int;
6868
if (width < 2 || width > 8) {
69-
mp_raise_ValueError(translate("width must be from 2 to 8 (inclusive)"));
69+
mp_raise_ValueError_varg(translate("width must be from 2 to 8 (inclusive), not %d"), width);
7070
}
7171

7272
mp_buffer_info_t input_bufinfo;

0 commit comments

Comments
 (0)