From 08386c836ee17e4ebae207cb27045e6999e1d250 Mon Sep 17 00:00:00 2001 From: Jakob Schlyter Date: Wed, 26 Jun 2024 09:09:20 +0200 Subject: [PATCH] use asyncio.run --- chargeamps/cli.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/chargeamps/cli.py b/chargeamps/cli.py index 7433ebe..f74ccd7 100644 --- a/chargeamps/cli.py +++ b/chargeamps/cli.py @@ -324,11 +324,7 @@ async def main_loop() -> None: def main() -> None: - loop = asyncio.get_event_loop() - try: - loop.run_until_complete(main_loop()) - finally: - loop.close() + asyncio.run(main_loop()) if __name__ == "__main__":