diff options
| author | Damien George <damien.p.george@gmail.com> | 2018-10-01 15:22:03 +1000 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2018-10-01 15:22:03 +1000 |
| commit | 4ab397576ff75bd212382105c97257d0139e17e9 (patch) | |
| tree | 020307f2ba51a6c20ee4938d24031da841339766 /py/runtime.c | |
| parent | 86819a52fec0e8337ac152564eec092984859884 (diff) | |
py/runtime: Use mp_import_name to implement tail of mp_import_from.
Diffstat (limited to 'py/runtime.c')
| -rw-r--r-- | py/runtime.c | 11 |
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 |
