summaryrefslogtreecommitdiffstatshomepage
path: root/py/objstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/objstr.c')
-rw-r--r--py/objstr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/py/objstr.c b/py/objstr.c
index 84a6f30aad..f5939d1b1f 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);
}