diff options
| author | Damien George <damien.p.george@gmail.com> | 2014-04-05 22:36:42 +0100 |
|---|---|---|
| committer | Damien George <damien.p.george@gmail.com> | 2014-04-05 22:36:42 +0100 |
| commit | 7efc5b3f346869cd4177760e6a6b2bb863b425da (patch) | |
| tree | 04fbe840f20ab84bee79d28882601812279c8718 /py/builtinimport.c | |
| parent | 8b0535e23fb1c646103a060a4ae17e9ee6d5e887 (diff) | |
py: Make globals and locals proper dictionary objects.
Finishes addressing issue #424.
In the end this was a very neat refactor that now makes things a lot
more consistent across the py code base. It allowed some
simplifications in certain places, now that everything is a dict object.
Also converted builtins tables to dictionaries. This will be useful
when we need to turn builtins into a proper module.
Diffstat (limited to 'py/builtinimport.c')
| -rw-r--r-- | py/builtinimport.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/py/builtinimport.c b/py/builtinimport.c index fd0689c68..e2137237f 100644 --- a/py/builtinimport.c +++ b/py/builtinimport.c @@ -83,12 +83,12 @@ void do_load(mp_obj_t module_obj, vstr_t *file) { qstr source_name = mp_lexer_source_name(lex); // save the old context - mp_map_t *old_locals = mp_locals_get(); - mp_map_t *old_globals = mp_globals_get(); + mp_obj_dict_t *old_locals = mp_locals_get(); + mp_obj_dict_t *old_globals = mp_globals_get(); // set the new context - mp_locals_set(mp_obj_dict_get_map(mp_obj_module_get_globals(module_obj))); - mp_globals_set(mp_obj_dict_get_map(mp_obj_module_get_globals(module_obj))); + mp_locals_set(mp_obj_module_get_globals(module_obj)); + mp_globals_set(mp_obj_module_get_globals(module_obj)); // parse the imported script mp_parse_error_kind_t parse_error_kind; |
