From 5fd5af98d0292e06f42e0e0dc6ea8278219cdd6e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 25 May 2014 22:12:56 +0300 Subject: objlist: Implement support for arbitrary (3-arg) slices. --- py/objstr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'py/objstr.c') diff --git a/py/objstr.c b/py/objstr.c index 84a6f30aa..f5939d1b1 100644 --- a/py/objstr.c +++ b/py/objstr.c @@ -353,7 +353,8 @@ STATIC mp_obj_t str_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)) { - assert(0); + nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError, + "Only slices with step=1 (aka None) are supported")); } return str_new(type, self_data + slice.start, slice.stop - slice.start); } -- cgit v1.2.3