diff options
author | Damien George <damien.p.george@gmail.com> | 2014-06-01 13:49:35 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-06-01 13:49:35 +0100 |
commit | c49ddb9315b8a3839439727d5a3df1f4226777e1 (patch) | |
tree | 1c91fb61706f2f8083dd1564890679c7935348f5 /py/objarray.c | |
parent | 3ebd4d0cae58241c963cabd3cbd02fc9ca261a2f (diff) | |
download | micropython-c49ddb9315b8a3839439727d5a3df1f4226777e1.tar.gz micropython-c49ddb9315b8a3839439727d5a3df1f4226777e1.zip |
py: Fix configurability of builtin slice.
Diffstat (limited to 'py/objarray.c')
-rw-r--r-- | py/objarray.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/py/objarray.c b/py/objarray.c index 91fcec624a..44fbf2f998 100644 --- a/py/objarray.c +++ b/py/objarray.c @@ -169,7 +169,9 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value return MP_OBJ_NULL; // op not supported } else { mp_obj_array_t *o = self_in; - if (MP_OBJ_IS_TYPE(index_in, &mp_type_slice)) { + if (0) { +#if MICROPY_PY_BUILTINS_SLICE + } else if (MP_OBJ_IS_TYPE(index_in, &mp_type_slice)) { if (value != MP_OBJ_SENTINEL) { // Only getting a slice is suported so far, not assignment // TODO: confirmed that both bytearray and array.array support @@ -187,6 +189,7 @@ STATIC mp_obj_t array_subscr(mp_obj_t self_in, mp_obj_t index_in, mp_obj_t value byte *p = o->items; memcpy(res->items, p + slice.start * sz, (slice.stop - slice.start) * sz); return res; +#endif } else { uint index = mp_get_index(o->base.type, o->len, index_in, false); if (value == MP_OBJ_SENTINEL) { |