Skip to content

Commit f87b35e

Browse files
committed
py: Fix mp_arg_parse_all.
1 parent 13c19c5 commit f87b35e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

py/argcheck.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ void mp_arg_parse_all(uint n_pos, const mp_obj_t *pos, mp_map_t *kws, uint n_all
5757
given_arg = kw->value;
5858
}
5959
}
60-
if (allowed[i].flags == MP_ARG_PARSE_BOOL) {
60+
if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_BOOL) {
6161
out_vals[i].u_bool = mp_obj_is_true(given_arg);
62-
} else if (allowed[i].flags == MP_ARG_PARSE_INT) {
62+
} else if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_INT) {
6363
out_vals[i].u_int = mp_obj_get_int(given_arg);
64-
} else if (allowed[i].flags == MP_ARG_PARSE_OBJ) {
64+
} else if ((allowed[i].flags & MP_ARG_PARSE_KIND_MASK) == MP_ARG_PARSE_OBJ) {
6565
out_vals[i].u_obj = given_arg;
6666
} else {
6767
assert(0);

0 commit comments

Comments
 (0)