From bb787151974b49a24e593663daddad49eee1e234 Mon Sep 17 00:00:00 2001 From: Paarth Shah Date: Wed, 5 Feb 2025 13:51:30 -0800 Subject: [PATCH] Update README example with `asyncio.run` [asyncio.run](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run) is the current, documented method to begin and clean up an async event loop, as of python3.7. python3.9 is the oldest version of python that isn't EOL. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index ab23f5ee..b8d74987 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,7 @@ async def main(): if __name__ == '__main__': - loop = asyncio.get_event_loop() - loop.run_until_complete(main()) - loop.close() + asyncio.run(main()) ``` More complicated examples, like asynchronous multiple watch or tail logs from pods,