Skip to content

Commit

Permalink
Use is_alive for threads. (#510)
Browse files Browse the repository at this point in the history
isAlive was deprecated in Python 3.8 and then removed in 3.9,
so switch to is_alive.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Apr 27, 2021
1 parent 5a6abc2 commit d512b5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions topic_monitor/topic_monitor/scripts/topic_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ def main():
topic_monitor_display = TopicMonitorDisplay(topic_monitor, args.stats_calc_period)

last_time = time.time()
while data_receiving_thread.isAlive():
while data_receiving_thread.is_alive():
now = time.time()
if now - last_time > args.stats_calc_period:
last_time = now
Expand All @@ -427,7 +427,7 @@ def main():
topic_monitor_display.update_display()

finally:
if data_receiving_thread.isAlive():
if data_receiving_thread.is_alive():
data_receiving_thread.stop()
# Block this thread until the other thread terminates
data_receiving_thread.join()
Expand Down

0 comments on commit d512b5c

Please sign in to comment.