Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Revert "Fix slice indices failure."
  • Loading branch information
dunkmann00 authored Jun 5, 2021
commit 1f85b953bf687df01d5c792cb3f551bd87da77d5
4 changes: 1 addition & 3 deletions adafruit_pypixelbuf.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,7 @@ def _set_item(

def __setitem__(self, index, val):
if isinstance(index, slice):
start = index.start if index.start is not None else 0
stop = index.stop if index.stop is not None else len(self)
step = index.step if index.step is not None else 1
start, stop, step = index.indices(self._pixels)
for val_i, in_i in enumerate(range(start, stop, step)):
r, g, b, w = self._parse_color(val[val_i])
self._set_item(in_i, r, g, b, w)
Expand Down