summaryrefslogtreecommitdiff
path: root/py/runtime.c
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2014-03-24 01:14:59 +0000
committerDamien George <damien.p.george@gmail.com>2014-03-24 01:14:59 +0000
commit4750a8398b62107753d684b18e9cf2534f5de155 (patch)
tree31c68a910a97eccc88bd3df61a94e77a30303afa /py/runtime.c
parent4b2b7ceca7915d014a191d3776bc29bdbc5faf02 (diff)
parentf909034400b3552c933582357d1986dae5b70d04 (diff)
Merge pull request #367 from pfalcon/del-name
py: Implement support for "except Exception as var" clause.
Diffstat (limited to 'py/runtime.c')
-rw-r--r--py/runtime.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/py/runtime.c b/py/runtime.c
index bbd12895a..58c662008 100644
--- a/py/runtime.c
+++ b/py/runtime.c
@@ -462,6 +462,11 @@ void rt_store_name(qstr qstr, mp_obj_t obj) {
mp_map_lookup(map_locals, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = obj;
}
+void rt_delete_name(qstr qstr) {
+ DEBUG_OP_printf("delete name %s\n", qstr_str(qstr));
+ mp_map_lookup(map_locals, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP_REMOVE_IF_FOUND);
+}
+
void rt_store_global(qstr qstr, mp_obj_t obj) {
DEBUG_OP_printf("store global %s <- %p\n", qstr_str(qstr), obj);
mp_map_lookup(map_globals, MP_OBJ_NEW_QSTR(qstr), MP_MAP_LOOKUP_ADD_IF_NOT_FOUND)->value = obj;