Add suggestion by @kvid

Co-authored-by: kvid <kvid@users.noreply.github.com>
This commit is contained in:
Daniel Rojas 2020-11-13 15:27:15 +01:00 committed by GitHub
parent 03a207de92
commit 0d62b01f31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,9 +121,9 @@ class Connector:
self.pincount = 1
if not self.pincount:
if not self.pins and not self.pinlabels:
raise Exception('You need to specify at least one, pincount, pins or pinlabels')
self.pincount = max(len(self.pins), len(self.pinlabels), len(self.pincolors))
if not self.pincount:
raise Exception('You need to specify at least one, pincount, pins, pinlabels, or pincolors')
# create default list for pins (sequential) if not specified
if not self.pins: