[Python-checkins] bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)

Miss Islington (bot) webhook-mailer at python.org
Fri Sep 28 11:40:13 EDT 2018


https://github.com/python/cpython/commit/37aae9dcf18753b8ffda99d1a5758a90af852464
commit: 37aae9dcf18753b8ffda99d1a5758a90af852464
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
date: 2018-09-28T08:40:08-07:00
summary:

bpo-34687: Update asyncio doc for ProactorEventLoop (GH-9623)



Since ProactorEventLoop is now the default in 3.8, remove examples
using it explicitly on Windows.





https://bugs.python.org/issue34687

files:
M Doc/library/asyncio-eventloop.rst
M Doc/library/asyncio-protocol.rst
M Doc/library/asyncio-subprocess.rst

diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst
index 50d6ea4b1389..76c8ce9943ef 100644
--- a/Doc/library/asyncio-eventloop.rst
+++ b/Doc/library/asyncio-eventloop.rst
@@ -1432,15 +1432,6 @@ on all platforms.
 
    Availability: Windows.
 
-   An example how to use :class:`ProactorEventLoop` on Windows::
-
-        import asyncio
-        import sys
-
-        if sys.platform == 'win32':
-            loop = asyncio.ProactorEventLoop()
-            asyncio.set_event_loop(loop)
-
    .. seealso::
 
       `MSDN documentation on I/O Completion Ports
diff --git a/Doc/library/asyncio-protocol.rst b/Doc/library/asyncio-protocol.rst
index bdfdcf7ddb6e..14ec31a6d5d2 100644
--- a/Doc/library/asyncio-protocol.rst
+++ b/Doc/library/asyncio-protocol.rst
@@ -1030,10 +1030,6 @@ The subprocess is created by th :meth:`loop.subprocess_exec` method::
         data = bytes(protocol.output)
         return data.decode('ascii').rstrip()
 
-    if sys.platform == "win32":
-        asyncio.set_event_loop_policy(
-            asyncio.WindowsProactorEventLoopPolicy())
-
     date = asyncio.run(get_date())
     print(f"Current date: {date}")
 
diff --git a/Doc/library/asyncio-subprocess.rst b/Doc/library/asyncio-subprocess.rst
index 0bcf66175ce3..a2cf51734848 100644
--- a/Doc/library/asyncio-subprocess.rst
+++ b/Doc/library/asyncio-subprocess.rst
@@ -344,10 +344,6 @@ function::
         await proc.wait()
         return line
 
-    if sys.platform == "win32":
-        asyncio.set_event_loop_policy(
-            asyncio.WindowsProactorEventLoopPolicy())
-
     date = asyncio.run(get_date())
     print(f"Current date: {date}")
 



More information about the Python-checkins mailing list