Example to use a :class:`ProactorEventLoop` on Windows::
- import asyncio, os
+ import asyncio, sys
- if os.name == 'nt':
+ if sys.platform == 'win32':
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
Set the current event loop policy. If *policy* is ``None``, the default
policy is restored.
-
support subprocesses. :class:`ProactorEventLoop` should be used instead.
Example to use it on Windows::
- import asyncio, os
+ import asyncio, sys
- if os.name == 'nt':
+ if sys.platform == 'win32':
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)