Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
micropython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
card10
micropython
Commits
d23834bc
Commit
d23834bc
authored
8 years ago
by
Damien George
Browse files
Options
Downloads
Patches
Plain Diff
py/builtinimport: Remove unreachable code and change obj-import comment.
parent
63e291de
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
py/builtinimport.c
+4
-10
4 additions, 10 deletions
py/builtinimport.c
with
4 additions
and
10 deletions
py/builtinimport.c
+
4
−
10
View file @
d23834bc
...
...
@@ -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
);
// T
ODO: We cannot just break here, at the very least, we must execut
e
//
trailer code below. But otherwise if there're remaining components,
// th
at would be (??) object p
at
h
w
ithin module, not modules path within FS.
//
break;
// T
his should be the last component in the import path. If there ar
e
//
remaining components then it's an ImportError because the current path
//
(
th
e module th
at w
as 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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment