Enforce sequence type when setting Setting.track (#3071)

This commit is contained in:
John Vincent Cauilan 2024-07-08 09:37:17 -05:00 committed by GitHub
parent 1b22dd28d4
commit b11f8b73ca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,4 @@
from collections.abc import Iterable, Mapping, MutableSequence
from collections.abc import Iterable, Mapping, MutableSequence, Sequence
from enum import Enum
import itertools
from math import ceil
@ -819,7 +819,7 @@ class Settings:
@track.setter
def track(self, track: typing.Iterable[typing.Iterable[int]]):
cv.check_type('track', track, Iterable)
cv.check_type('track', track, Sequence)
for t in track:
if len(t) != 3:
msg = f'Unable to set the track to "{t}" since its length is not 3'