palette2: Fix errors with bad handling of NoneType in a few locations
Issue specific to Python 3, NoneType is being used to compare heartbeat time (actually caused by invalid condition operator), and by returning NoneType in timer functions. Signed-off-by: Clifford Roche <clifford.roche@gmail.com>
This commit is contained in:
parent
6ae6aaf711
commit
40d8c2ef16
|
@ -221,9 +221,9 @@ class Palette2:
|
|||
def _wait_for_heartbeat(self):
|
||||
startTs = self.reactor.monotonic()
|
||||
currTs = startTs
|
||||
while self.heartbeat is None and self.heartbeat < (
|
||||
while self.heartbeat is None or (self.heartbeat < (
|
||||
currTs - SETUP_TIMEOUT) and startTs > (
|
||||
currTs - SETUP_TIMEOUT):
|
||||
currTs - SETUP_TIMEOUT)):
|
||||
currTs = self.reactor.pause(currTs + 1.)
|
||||
|
||||
if self.heartbeat < (currTs - SETUP_TIMEOUT):
|
||||
|
@ -401,7 +401,7 @@ class Palette2:
|
|||
try:
|
||||
fw = params[0][1:]
|
||||
logging.info(
|
||||
"Palette 2 firmware version %s detected" % os.fwalk)
|
||||
"Palette 2 firmware version %s detected" % fw)
|
||||
except (TypeError, IndexError):
|
||||
logging.error("Unable to parse firmware version")
|
||||
|
||||
|
@ -613,6 +613,7 @@ class Palette2:
|
|||
self.signal_disconnect = True
|
||||
return self.reactor.NEVER
|
||||
return eventtime + SERIAL_TIMER
|
||||
return eventtime + SERIAL_TIMER
|
||||
|
||||
def _run_Smart_Load(self, eventtime):
|
||||
if not self.is_splicing and self.remaining_load_length < 0:
|
||||
|
|
Loading…
Reference in New Issue