Skip to content

Commit

Permalink
patch deprecated asyncio.get_event_loop()
Browse files Browse the repository at this point in the history
asyncio.get_event_loop() is deprecated in versions higher than 3.10
used new event loop and set event loop instead
  • Loading branch information
dootss authored Dec 18, 2023
1 parent 8190e04 commit 489c953
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ async def check_url(_):
print(' STARTING...')
threading.Thread(target=status_board, daemon=True).start()

loop = asyncio.get_event_loop()
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)

tasks = [check_url(i) for i in range(threads)]
try:
loop.run_until_complete(asyncio.gather(*tasks))
Expand Down

0 comments on commit 489c953

Please sign in to comment.