the semantics of * range()* function have changed in python 3. range no longer returns a list, but rather a range object from which you can infer a list of ints.
I imagine there are a number of places where a range being used instead of a list of ints, will cause the same problem. Regular slicing seems to be OK.
However, this works when you explicitly cast the range into a list.
Complete code that will demonstrates the problem