fix use of mp_type_fileio
This commit is contained in:
parent
99479a69f8
commit
f812750a76
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user