summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/py/runtime.c b/py/runtime.c
index c933a8007..13a7e7426 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1361,15 +1361,8 @@ import_error:
qstr dot_name_q = qstr_from_strn(dot_name, dot_name_len);
mp_local_free(dot_name);
- mp_obj_t args[5];
- args[0] = MP_OBJ_NEW_QSTR(dot_name_q);
- args[1] = mp_const_none; // TODO should be globals
- args[2] = mp_const_none; // TODO should be locals
- args[3] = mp_const_true; // Pass sentinel "non empty" value to force returning of leaf module
- args[4] = MP_OBJ_NEW_SMALL_INT(0);
-
- // TODO lookup __import__ and call that instead of going straight to builtin implementation
- return mp_builtin___import__(5, args);
+ // For fromlist, pass sentinel "non empty" value to force returning of leaf module
+ return mp_import_name(dot_name_q, mp_const_true, MP_OBJ_NEW_SMALL_INT(0));
#else