diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-05 22:11:01 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-05 22:11:01 +0000 |
commit | 8428b8f3c94fb4adab6b094c1e0718168ebd8cbd (patch) | |
tree | 06cfd0bcfb68771884761209939c47adc8457657 /py/builtinimport.c | |
parent | f1c6ad46afa3eaf6df999cd51eb406110b6cac69 (diff) | |
parent | 12e2656472bf53e467c066eda6f3e177a97210ca (diff) | |
download | micropython-8428b8f3c94fb4adab6b094c1e0718168ebd8cbd.tar.gz micropython-8428b8f3c94fb4adab6b094c1e0718168ebd8cbd.zip |
Merge remote-tracking branch 'upstream/master' into list_insert
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r-- | py/builtinimport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index 47dbf21216..90a0fc3394 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -58,7 +58,9 @@ mp_obj_t mp_builtin___import__(int n, mp_obj_t *args) { return mp_const_none; } - if (!mp_compile(pn, false)) { + mp_obj_t module_fun = mp_compile(pn, false); + + if (module_fun == mp_const_none) { // TODO handle compile error correctly rt_locals_set(old_locals); rt_globals_set(old_globals); @@ -66,7 +68,6 @@ mp_obj_t mp_builtin___import__(int n, mp_obj_t *args) { } // complied successfully, execute it - mp_obj_t module_fun = rt_make_function_from_id(1); // TODO we should return from mp_compile the unique_code_id for the module nlr_buf_t nlr; if (nlr_push(&nlr) == 0) { rt_call_function_0(module_fun); |