Skip to content

Commit ff4b6da

Browse files
committed
sequence: Throw exception for not implemented slice steps.
1 parent 2705f4c commit ff4b6da

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

py/sequence.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ bool mp_seq_get_fast_slice_indexes(machine_uint_t len, mp_obj_t slice, machine_u
5656
machine_int_t start, stop;
5757
mp_obj_slice_get(slice, &ostart, &ostop, &ostep);
5858
if (ostep != mp_const_none && ostep != MP_OBJ_NEW_SMALL_INT(1)) {
59+
nlr_raise(mp_obj_new_exception_msg(&mp_type_NotImplementedError,
60+
"Only slices with step=1 (aka None) are supported"));
5961
return false;
6062
}
6163

0 commit comments

Comments
 (0)