Skip to content

Commit 1504929

Browse files
authored
Update README example with asyncio.run (#348)
[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.
1 parent f1d47ed commit 1504929

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

README.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ async def main():
5252

5353

5454
if __name__ == '__main__':
55-
loop = asyncio.get_event_loop()
56-
loop.run_until_complete(main())
57-
loop.close()
55+
asyncio.run(main())
5856
```
5957

6058
More complicated examples, like asynchronous multiple watch or tail logs from pods,

0 commit comments

Comments
 (0)