py/objrange: Bugfix for range_subscr() when index is a slice object.

This commit is contained in:
Tom Soulanille 2015-09-27 22:53:38 -07:00 committed by Damien George
parent 2a8a564fbd
commit f1a9923308
1 changed files with 3 additions and 3 deletions

View File

@ -148,9 +148,9 @@ STATIC mp_obj_t range_subscr(mp_obj_t self_in, mp_obj_t index, mp_obj_t value) {
mp_seq_get_fast_slice_indexes(len, index, &slice); mp_seq_get_fast_slice_indexes(len, index, &slice);
mp_obj_range_t *o = m_new_obj(mp_obj_range_t); mp_obj_range_t *o = m_new_obj(mp_obj_range_t);
o->base.type = &mp_type_range; o->base.type = &mp_type_range;
o->start = slice.start; o->start = self->start + slice.start * self->step;
o->stop = slice.stop; o->stop = self->start + slice.stop * self->step;
o->step = slice.step; o->step = slice.step * self->step;
return o; return o;
} }
#endif #endif