You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Although the ring() and single() library functions allow any integer value for ring_index, the code crashes when passed certain values due to modulo 7, which should be modulo 6 to correspond with the size of the lists in _legs.
Steps to reproduce, creating a wormhole-in-space effect:
$ cat piglow-ring-modulo-bug.py
import piglow
for x in range(20):
piglow.ring(x, 100)
piglow.ring(x+1, 0)
piglow.show()
$ python3 piglow-ring-modulo-bug.py
Traceback (most recent call last):
File "/home/pi/piglow-ring-modulo-bug.py", line 5, in <module>
piglow.ring(x+1, 0)
File "/home/pi/piglow-pristine/piglow/library/piglow.py", line 181, in ring
_set([_legs[0][ring_index], _legs[1][ring_index], _legs[2][ring_index]], value)
IndexError: list index out of range
The text was updated successfully, but these errors were encountered:
Although the
ring()
andsingle()
library functions allow any integer value forring_index
, the code crashes when passed certain values due to modulo 7, which should be modulo 6 to correspond with the size of the lists in_legs
.Steps to reproduce, creating a wormhole-in-space effect:
The text was updated successfully, but these errors were encountered: