Validate builtin member is a module

This commit is contained in:
Scott Shawcroft 2020-02-26 10:32:02 -08:00
parent 86fd93bd03
commit 6375d8699e
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
1 changed files with 1 additions and 1 deletions

View File

@ -421,7 +421,7 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) {
MP_MAP_LOOKUP);
}
if (el != NULL) {
if (el != NULL && MP_OBJ_IS_TYPE(el->value, &mp_type_module)) {
module_obj = el->value;
mp_module_call_init(mod_name, module_obj);
} else {