Get rid of client.loop

Instead, use the asyncio-intended way of implicit loop.
This commit is contained in:
Lonami Exo
2022-01-16 13:51:23 +01:00
parent 6eadc8aed8
commit a62627534e
19 changed files with 140 additions and 177 deletions

View File

@@ -132,7 +132,7 @@ class App(tkinter.Tk):
command=self.send_message).grid(row=3, column=2)
# Post-init (async, connect client)
self.cl.loop.create_task(self.post_init())
asyncio.create_task(self.post_init())
async def post_init(self):
"""
@@ -369,10 +369,4 @@ async def main(interval=0.05):
if __name__ == "__main__":
# Some boilerplate code to set up the main method
aio_loop = asyncio.get_event_loop()
try:
aio_loop.run_until_complete(main())
finally:
if not aio_loop.is_closed():
aio_loop.close()
asyncio.run(main())