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
This commit is contained in:
parent
077061a7b2
commit
37aae9dcf1
@ -1432,15 +1432,6 @@ on all platforms.
|
|||||||
|
|
||||||
Availability: Windows.
|
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::
|
.. seealso::
|
||||||
|
|
||||||
`MSDN documentation on I/O Completion Ports
|
`MSDN documentation on I/O Completion Ports
|
||||||
|
@ -1030,10 +1030,6 @@ The subprocess is created by th :meth:`loop.subprocess_exec` method::
|
|||||||
data = bytes(protocol.output)
|
data = bytes(protocol.output)
|
||||||
return data.decode('ascii').rstrip()
|
return data.decode('ascii').rstrip()
|
||||||
|
|
||||||
if sys.platform == "win32":
|
|
||||||
asyncio.set_event_loop_policy(
|
|
||||||
asyncio.WindowsProactorEventLoopPolicy())
|
|
||||||
|
|
||||||
date = asyncio.run(get_date())
|
date = asyncio.run(get_date())
|
||||||
print(f"Current date: {date}")
|
print(f"Current date: {date}")
|
||||||
|
|
||||||
|
@ -344,10 +344,6 @@ function::
|
|||||||
await proc.wait()
|
await proc.wait()
|
||||||
return line
|
return line
|
||||||
|
|
||||||
if sys.platform == "win32":
|
|
||||||
asyncio.set_event_loop_policy(
|
|
||||||
asyncio.WindowsProactorEventLoopPolicy())
|
|
||||||
|
|
||||||
date = asyncio.run(get_date())
|
date = asyncio.run(get_date())
|
||||||
print(f"Current date: {date}")
|
print(f"Current date: {date}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user