fix use of mp_type_fileio

This commit is contained in:
Jeff Epler 2023-09-22 13:56:55 -05:00
parent 99479a69f8
commit f812750a76
No known key found for this signature in database
GPG Key ID: D5BF15AB975AB4DE
2 changed files with 2 additions and 2 deletions

View File

@ -79,7 +79,7 @@ STATIC mp_obj_t audioio_wavefile_make_new(const mp_obj_type_t *type, size_t n_ar
}
audioio_wavefile_obj_t *self = mp_obj_malloc(audioio_wavefile_obj_t, &audioio_wavefile_type);
if (!mp_obj_is_type(arg, &mp_type_fileio)) {
if (!mp_obj_is_type(arg, &mp_type_vfs_fat_fileio)) {
mp_raise_TypeError(translate("file must be a file opened in byte mode"));
}
uint8_t *buffer = NULL;

View File

@ -224,7 +224,7 @@ STATIC mp_obj_t synthio_from_file(size_t n_args, const mp_obj_t *pos_args, mp_ma
};
mp_arg_val_t args[MP_ARRAY_SIZE(allowed_args)];
mp_arg_parse_all(n_args, pos_args, kw_args, MP_ARRAY_SIZE(allowed_args), allowed_args, args);
if (!mp_obj_is_type(args[ARG_file].u_obj, &mp_type_fileio)) {
if (!mp_obj_is_type(args[ARG_file].u_obj, &mp_type_vfs_fat_fileio)) {
mp_raise_TypeError(translate("file must be a file opened in byte mode"));
}
pyb_file_obj_t *file = MP_OBJ_TO_PTR(args[ARG_file].u_obj);