diff options
author | John R. Lenton <jlenton@gmail.com> | 2014-01-03 22:55:16 +0000 |
---|---|---|
committer | John R. Lenton <jlenton@gmail.com> | 2014-01-03 22:55:16 +0000 |
commit | 97334c85d0b53ef1648eb76ec6e9e2b1efab1f97 (patch) | |
tree | d10f6b6b7ca3394e6f7dc31ca55e0df2b39abe02 /py/builtin.c | |
parent | 25f417c08c2cdb5c4a7564d1e69766c0448d7984 (diff) | |
parent | b7aa72710ee6798c6d2bc2632be24206e526fc1e (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'py/builtin.c')
-rw-r--r-- | py/builtin.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/py/builtin.c b/py/builtin.c index 2b94163f1..d29a2bf8c 100644 --- a/py/builtin.c +++ b/py/builtin.c @@ -16,30 +16,20 @@ mp_obj_t mp_builtin___build_class__(mp_obj_t o_class_fun, mp_obj_t o_class_name) { // we differ from CPython: we set the new __locals__ object here - mp_map_t *old_locals = rt_get_map_locals(); + mp_map_t *old_locals = rt_locals_get(); mp_map_t *class_locals = mp_map_new(MP_MAP_QSTR, 0); - rt_set_map_locals(class_locals); + rt_locals_set(class_locals); // call the class code rt_call_function_1(o_class_fun, (mp_obj_t)0xdeadbeef); // restore old __locals__ object - rt_set_map_locals(old_locals); + rt_locals_set(old_locals); // create and return the new class return mp_obj_new_class(class_locals); } -mp_obj_t mp_builtin___import__(int n, mp_obj_t *args) { - printf("import:\n"); - for (int i = 0; i < n; i++) { - printf(" "); - mp_obj_print(args[i]); - printf("\n"); - } - return mp_const_none; -} - mp_obj_t mp_builtin___repl_print__(mp_obj_t o) { if (o != mp_const_none) { mp_obj_print(o); |