slice: Allow building with MICROPY_ENABLE_SLICE=0.
diff --git a/py/objstr.c b/py/objstr.c
index 54dd087..8e3e9d9 100644
--- a/py/objstr.c
+++ b/py/objstr.c
@@ -35,6 +35,7 @@
if (MP_OBJ_IS_SMALL_INT(rhs_in)) {
// TODO: This implements byte string access for single index so far
return mp_obj_new_int(lhs_str[mp_obj_get_int(rhs_in)]);
+#if MICROPY_ENABLE_SLICE
} else if (MP_OBJ_IS_TYPE(rhs_in, &slice_type)) {
int start, stop, step;
mp_obj_slice_get(rhs_in, &start, &stop, &step);
@@ -47,6 +48,7 @@
stop = len + stop;
}
return mp_obj_new_str(qstr_from_strn_copy(lhs_str + start, stop - start));
+#endif
} else {
// Throw TypeError here
assert(0);