diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-05 01:57:54 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-05 01:57:54 +0000 |
commit | 7e73a8fd09a8070a3bbb90d2ddc4f04af4e2828a (patch) | |
tree | 606e074a1955f381c68d1689946066e9eb1a5a47 /py/builtinimport.c | |
parent | 5d4a8213395b1e27d303379772c90b3b0adc82d5 (diff) | |
parent | 45b43c21c4f8e30dcff00c2429eddba20ca002aa (diff) | |
download | micropython-7e73a8fd09a8070a3bbb90d2ddc4f04af4e2828a.tar.gz micropython-7e73a8fd09a8070a3bbb90d2ddc4f04af4e2828a.zip |
Merge remote-tracking branch 'upstream/master' into list_index
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); |