Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
feacaa12
Commit
feacaa12
authored
Feb 21, 2014
by
Paul Sokolovsky
Browse files
__import__: Catch relative import attempts and throw NotImplementedError.
parent
a8d31b28
Changes
1
Hide whitespace changes
Inline
Side-by-side
py/builtinimport.c
View file @
feacaa12
...
...
@@ -140,8 +140,17 @@ mp_obj_t mp_builtin___import__(int n_args, mp_obj_t *args) {
*/
mp_obj_t
fromtuple
=
mp_const_none
;
int
level
=
0
;
if
(
n_args
>=
4
)
{
fromtuple
=
args
[
3
];
if
(
n_args
>=
5
)
{
level
=
MP_OBJ_SMALL_INT_VALUE
(
args
[
4
]);
}
}
if
(
level
!=
0
)
{
nlr_jump
(
mp_obj_new_exception_msg
(
&
mp_type_NotImplementedError
,
"Relative import is not implemented"
));
}
uint
mod_len
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment