We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3aacb35 commit 31ba48cCopy full SHA for 31ba48c
README.rst
@@ -53,20 +53,23 @@ uvloop with::
53
Using uvloop
54
------------
55
56
-Call ``uvloop.install()`` before calling ``asyncio.run()`` or
57
-manually creating an asyncio event loop:
58
-
59
.. code:: python
60
61
import asyncio
+ import sys
+
62
import uvloop
63
64
async def main():
65
# Main entry-point.
66
...
67
68
- uvloop.install()
69
- asyncio.run(main())
+ if sys.version_info >= (3, 11)
+ with asyncio.Runner(loop_factory=uvloop.new_event_loop) as runner:
+ runner.run(main())
70
+ else:
71
+ uvloop.install()
72
+ asyncio.run(main())
73
74
75
Building From Source
0 commit comments