call common validation function

Co-authored-by: MicroDev <70126934+microdev1@users.noreply.github.com>
This commit is contained in:
Jeff Epler 2023-03-22 10:16:48 -05:00 committed by GitHub
parent 349dedca54
commit 98c546bf57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -167,9 +167,7 @@ void shared_modules_struct_pack_into(mp_obj_t fmt_in, byte *p, byte *end_p, size
} }
fmt++; fmt++;
} }
if (i != n_args) { (void)mp_arg_validate_length(n_args, i, MP_QSTR_args);
mp_raise_ValueError_varg(translate("%q length must be %d"), MP_QSTR_args, i);
}
} }
mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) { mp_obj_tuple_t *shared_modules_struct_unpack_from(mp_obj_t fmt_in, byte *p, byte *end_p, bool exact_size) {