Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c6bf822

Browse filesBrowse files
miss-islingtonkumaraditya303
authored andcommitted
GH-82604: fix docs about configuring selector (GH-97755)
(cherry picked from commit 53503ff) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
1 parent 9d49bd4 commit c6bf822
Copy full SHA for c6bf822

File tree

Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-3
lines changed

‎Doc/library/asyncio-eventloop.rst

Copy file name to clipboardExpand all lines: Doc/library/asyncio-eventloop.rst
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,9 +1638,12 @@ on Unix and :class:`ProactorEventLoop` on Windows.
16381638
import asyncio
16391639
import selectors
16401640

1641-
selector = selectors.SelectSelector()
1642-
loop = asyncio.SelectorEventLoop(selector)
1643-
asyncio.set_event_loop(loop)
1641+
class MyPolicy(asyncio.DefaultEventLoopPolicy):
1642+
def new_event_loop(self):
1643+
selector = selectors.SelectSelector()
1644+
return asyncio.SelectorEventLoop(selector)
1645+
1646+
asyncio.set_event_loop_policy(MyPolicy())
16441647

16451648

16461649
.. availability:: Unix, Windows.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.