Skip to content

Commit 4fcbadb

Browse files
committed
Drop xrange/range shim.
1 parent c23f472 commit 4fcbadb

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

library/rpi_ws281x/rpi_ws281x.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44
import atexit
55

66

7-
try:
8-
xrange(0)
9-
except NameError:
10-
xrange = range
11-
12-
137
def Color(red, green, blue, white=0):
148
"""Convert the provided red, green, blue color to a 24-bit color value.
159
Each color component should be a value 0-255 where 0 is the lowest intensity
@@ -81,7 +75,7 @@ def __getitem__(self, pos):
8175
# Handle if a slice of positions are passed in by grabbing all the values
8276
# and returning them in a list.
8377
if isinstance(pos, slice):
84-
return [ws.ws2811_led_get(self._channel, n) for n in xrange(*pos.indices(self.size))]
78+
return [ws.ws2811_led_get(self._channel, n) for n in range(*pos.indices(self.size))]
8579
# Else assume the passed in value is a number to the position.
8680
else:
8781
return ws.ws2811_led_get(self._channel, pos)
@@ -93,7 +87,7 @@ def __setitem__(self, pos, value):
9387
# Handle if a slice of positions are passed in by setting the appropriate
9488
# LED data values to the provided value.
9589
if isinstance(pos, slice):
96-
for n in xrange(*pos.indices(self.size)):
90+
for n in range(*pos.indices(self.size)):
9791
ws.ws2811_led_set(self._channel, n, value)
9892
# Else assume the passed in value is a number to the position.
9993
else:

0 commit comments

Comments
 (0)