Skip to content

Commit

Permalink
semonitor: Replace isSet with is_set
Browse files Browse the repository at this point in the history
The `isSet` is deprecated and an alias for `is_set`. Use that instead to
avoid deprecation warnings.

Signed-off-by: Olliver Schinagl <[email protected]>
  • Loading branch information
oliv3r committed Jun 21, 2023
1 parent 8f72df1 commit 8555586
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions semonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def processMsg(msg, args, mode, state, dataFile, recFile, outFile, keyStr, updat
(time.localtime().tm_hour - time.gmtime().tm_hour) * 60 * 60)
elif function == se.commands.PROT_RESP_POLESTAR_MASTER_GRANT_ACK: # RS485 master release
masterEvent.set()
se.logutils.setState(state, "masterEvent", masterEvent.isSet())
se.logutils.setState(state, "masterEvent", masterEvent.is_set())
if replyFunction:
msg = se.msg.formatMsg(msgSeq, toAddr, fromAddr, replyFunction, replyData)
se.msg.sendMsg(dataFile, msg, recFile)
Expand Down Expand Up @@ -142,7 +142,7 @@ def masterGrant(state, dataFile, recFile, slaveAddr):
def masterTimerExpire():
logger.debug("RS485 master ack timeout")
masterEvent.set()
se.logutils.setState(state, "masterEvent", masterEvent.isSet())
se.logutils.setState(state, "masterEvent", masterEvent.is_set())
se.logutils.setState(state, "masterTimer", False)

# start a timeout to release the bus if the slave doesn't respond
Expand All @@ -151,9 +151,9 @@ def masterTimerExpire():
se.logutils.setState(state, "masterTimer", True)
# wait for slave to release the bus
masterEvent.clear()
se.logutils.setState(state, "masterEvent", masterEvent.isSet())
se.logutils.setState(state, "masterEvent", masterEvent.is_set())
masterEvent.wait()
se.logutils.setState(state, "masterEvent", masterEvent.isSet())
se.logutils.setState(state, "masterEvent", masterEvent.is_set())
# cancel the timeout
masterTimer.cancel()
se.logutils.setState(state, "masterTimer", False)
Expand Down

0 comments on commit 8555586

Please sign in to comment.