summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-04-18 23:35:24 +0100
committerDamien George <damien.p.george@gmail.com>2014-04-18 23:35:24 +0100
commit561f83c9cf62b6470637dfbd51471db63fe5c28d (patch)
tree3b411eff835bec291095c823655698ee43c8849e /py/runtime.c
parent38ae014e4258811d1612f9e140a35f8f9aa0ddb8 (diff)
parent0fc4775cd6e13360bfd622602b50de900dac6617 (diff)
Merge branch 'master' of github.com:micropython/micropython
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/py/runtime.c b/py/runtime.c
index 7830301c7..30db01cd5 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -1060,10 +1060,14 @@ import_error:
void mp_import_all(mp_obj_t module) {
DEBUG_printf("import all %p\n", module);
+ // TODO: Support __all__
mp_map_t *map = mp_obj_dict_get_map(mp_obj_module_get_globals(module));
for (uint i = 0; i < map->alloc; i++) {
if (MP_MAP_SLOT_IS_FILLED(map, i)) {
- mp_store_name(MP_OBJ_QSTR_VALUE(map->table[i].key), map->table[i].value);
+ qstr name = MP_OBJ_QSTR_VALUE(map->table[i].key);
+ if (*qstr_str(name) != '_') {
+ mp_store_name(name, map->table[i].value);
+ }
}
}
}