Skip to content

Commit

Permalink
py/objrange: Bugfix for range_subscr() when index is a slice object.
Browse files Browse the repository at this point in the history
  • Loading branch information
altasoul authored and dpgeorge committed Sep 28, 2015
1 parent 2a8a564 commit f1a9923
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/objrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_obj_range_t *o = m_new_obj(mp_obj_range_t);
o->base.type = &mp_type_range;
o->start = slice.start;
o->stop = slice.stop;
o->step = slice.step;
o->start = self->start + slice.start * self->step;
o->stop = self->start + slice.stop * self->step;
o->step = slice.step * self->step;
return o;
}
#endif
Expand Down

0 comments on commit f1a9923

Please sign in to comment.