Olen/Spond

Modernise `asyncio` calls

Closed this issue · 0 comments

We shold probably change

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

to the "new" way to avoid warnings and errors in python 3.10 and 3.11:

loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
asyncio.run(main())

I believe this works fine in 3.7 as well?

Originally posted by @Olen in #44 (comment)

--
Note the older form also appears in commented-out code which can be removed if the "new" way to run async works in 3.7