diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-05 18:32:08 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-05 18:32:08 +0100 |
commit | ea13f407a392593e7746131952a57bad222ee882 (patch) | |
tree | 240fb586f678808bb5039a22e06a6214408adfc3 /py/objlist.c | |
parent | 2a037408af77d4c9e9cc98f5f12ea77fab93cc0e (diff) |
py: Change nlr_jump to nlr_raise, to aid in debugging.
This does not affect code size or performance when debugging turned off.
To address issue #420.
Diffstat (limited to 'py/objlist.c')
-rw-r--r-- | py/objlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/py/objlist.c b/py/objlist.c index 2a5f2c883..620bf2944 100644 --- a/py/objlist.c +++ b/py/objlist.c @@ -59,7 +59,7 @@ STATIC mp_obj_t list_make_new(mp_obj_t type_in, uint n_args, uint n_kw, const mp } default: - nlr_jump(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "list takes at most 1 argument, %d given", n_args)); + nlr_raise(mp_obj_new_exception_msg_varg(&mp_type_TypeError, "list takes at most 1 argument, %d given", n_args)); } return NULL; } @@ -184,7 +184,7 @@ STATIC mp_obj_t list_pop(uint n_args, const mp_obj_t *args) { assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); mp_obj_list_t *self = args[0]; if (self->len == 0) { - nlr_jump(mp_obj_new_exception_msg(&mp_type_IndexError, "pop from empty list")); + nlr_raise(mp_obj_new_exception_msg(&mp_type_IndexError, "pop from empty list")); } uint index = mp_get_index(self->base.type, self->len, n_args == 1 ? mp_obj_new_int(-1) : args[1], false); mp_obj_t ret = self->items[index]; @@ -224,7 +224,7 @@ mp_obj_t mp_obj_list_sort(uint n_args, const mp_obj_t *args, mp_map_t *kwargs) { assert(n_args >= 1); assert(MP_OBJ_IS_TYPE(args[0], &mp_type_list)); if (n_args > 1) { - nlr_jump(mp_obj_new_exception_msg(&mp_type_TypeError, + nlr_raise(mp_obj_new_exception_msg(&mp_type_TypeError, "list.sort takes no positional arguments")); } mp_obj_list_t *self = args[0]; |