do not throw ZeroDivisonError when pollinterval is 0
fast_interval might be 0, indicating to poll as fast as possible - this should not throw a zero division error Change-Id: I26e18f5a656c943b906c6ffff65361e1fcf16d50
This commit is contained in:
parent
edd3437682
commit
084e890645
@ -683,7 +683,10 @@ class Module(HasAccessibles):
|
|||||||
for mobj in modules:
|
for mobj in modules:
|
||||||
pinfo = mobj.pollInfo
|
pinfo = mobj.pollInfo
|
||||||
if now > pinfo.last_main + pinfo.interval:
|
if now > pinfo.last_main + pinfo.interval:
|
||||||
pinfo.last_main = (now // pinfo.interval) * pinfo.interval
|
try:
|
||||||
|
pinfo.last_main = (now // pinfo.interval) * pinfo.interval
|
||||||
|
except ZeroDivisionError:
|
||||||
|
pinfo.last_main = now
|
||||||
mobj.callPollFunc(mobj.doPoll)
|
mobj.callPollFunc(mobj.doPoll)
|
||||||
now = time.time()
|
now = time.time()
|
||||||
# find ONE due slow poll and call it
|
# find ONE due slow poll and call it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user