Since ProactorEventLoop is now the default in 3.8, remove examples
using it explicitly on Windows.
https://bugs.python.org/issue34687
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
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}")
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}")