Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit 4f005e5

Browse files
authored
Merge pull request #32 from dunkmann00/revert-31-slice-fix
Revert "Fix slice indices failure."
2 parents 088dbbf + 1f85b95 commit 4f005e5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

adafruit_pypixelbuf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,7 @@ def _set_item(
289289

290290
def __setitem__(self, index, val):
291291
if isinstance(index, slice):
292-
start = index.start if index.start is not None else 0
293-
stop = index.stop if index.stop is not None else len(self)
294-
step = index.step if index.step is not None else 1
292+
start, stop, step = index.indices(self._pixels)
295293
for val_i, in_i in enumerate(range(start, stop, step)):
296294
r, g, b, w = self._parse_color(val[val_i])
297295
self._set_item(in_i, r, g, b, w)

0 commit comments

Comments
 (0)