Skip to content

Commit 6375d86

Browse files
committed
Validate builtin member is a module
1 parent 86fd93b commit 6375d86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

py/builtinimport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
421421
MP_MAP_LOOKUP);
422422
}
423423

424-
if (el != NULL) {
424+
if (el != NULL && MP_OBJ_IS_TYPE(el->value, &mp_type_module)) {
425425
module_obj = el->value;
426426
mp_module_call_init(mod_name, module_obj);
427427
} else {

0 commit comments

Comments
 (0)