summaryrefslogtreecommitdiffstatshomepage
path: root/py/objtuple.c
diff options
context:
space:
mode:
authorJavier Candeira <javier@candeira.com>2017-08-09 14:40:45 +1000
committerJavier Candeira <javier@candeira.com>2017-08-13 22:52:33 +1000
commit35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db (patch)
tree26616de189a9154309287846bf76fb1cdab8ce51 /py/objtuple.c
parentb6a328956467339f568b19d9192fbbfdfa47a572 (diff)
downloadmicropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.tar.gz
micropython-35a1fea90b2cae9d5cc8e9eab62ba4c67e8786db.zip
all: Raise exceptions via mp_raise_XXX
- Changed: ValueError, TypeError, NotImplementedError - OSError invocations unchanged, because the corresponding utility function takes ints, not strings like the long form invocation. - OverflowError, IndexError and RuntimeError etc. not changed for now until we decide whether to add new utility functions.
Diffstat (limited to 'py/objtuple.c')
-rw-r--r--py/objtuple.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/objtuple.c b/py/objtuple.c
index cbe6454943..765edb907c 100644
--- a/py/objtuple.c
+++ b/py/objtuple.c
@@ -181,7 +181,7 @@ mp_obj_t mp_obj_tuple_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
if (MP_OBJ_IS_TYPE(index, &mp_type_slice)) {
mp_bound_slice_t slice;
if (!mp_seq_get_fast_slice_indexes(self->len, index, &slice)) {
- mp_not_implemented("only slices with step=1 (aka None) are supported");
+ mp_raise_NotImplementedError("only slices with step=1 (aka None) are supported");
}
mp_obj_tuple_t *res = MP_OBJ_TO_PTR(mp_obj_new_tuple(slice.stop - slice.start, NULL));
mp_seq_copy(res->items, self->items + slice.start, res->len, mp_obj_t);