diff options
author | Damien George <damien.p.george@gmail.com> | 2017-01-16 16:40:47 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-16 16:41:43 +1100 |
commit | d23834bc967126db5057ca1fa49e7768852e6a46 (patch) | |
tree | 93176601e5426434c257dc7269ffaf7d52352a65 /py/builtinimport.c | |
parent | 63e291de706c4c8092fe5f19f3726e5da5e80913 (diff) | |
download | micropython-d23834bc967126db5057ca1fa49e7768852e6a46.tar.gz micropython-d23834bc967126db5057ca1fa49e7768852e6a46.zip |
py/builtinimport: Remove unreachable code and change obj-import comment.
Diffstat (limited to 'py/builtinimport.c')
-rw-r--r-- | py/builtinimport.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index 0e3f160a73..329dcb193a 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -476,10 +476,10 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { path.len = orig_path_len; } else { // MP_IMPORT_STAT_FILE do_load(module_obj, &path); - // TODO: We cannot just break here, at the very least, we must execute - // trailer code below. But otherwise if there're remaining components, - // that would be (??) object path within module, not modules path within FS. - // break; + // This should be the last component in the import path. If there are + // remaining components then it's an ImportError because the current path + // (the module that was just loaded) is not a package. This will be caught + // on the next iteration because the file will not exist. } } if (outer_module_obj != MP_OBJ_NULL) { @@ -494,12 +494,6 @@ mp_obj_t mp_builtin___import__(size_t n_args, const mp_obj_t *args) { } } - if (i < mod_len) { - // we loaded a package, now need to load objects from within that package - // TODO - assert(0); - } - // If fromlist is not empty, return leaf module if (fromtuple != mp_const_none) { return module_obj; |