Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7280486 commit 6bc2396Copy full SHA for 6bc2396
1 file changed
Doc/library/asyncio-subprocess.rst
@@ -146,6 +146,7 @@ it does not use a shell. Get the output of the "python -m platform" command and
146
display the output::
147
148
import asyncio
149
+ import os
150
import sys
151
from asyncio import subprocess
152
@@ -164,7 +165,11 @@ display the output::
164
165
exitcode = yield from proc.wait()
166
return (exitcode, stdout)
167
- loop = asyncio.get_event_loop()
168
+ if os.name == 'nt':
169
+ loop = asyncio.ProactorEventLoop()
170
+ asyncio.set_event_loop(loop)
171
+ else:
172
+ loop = asyncio.get_event_loop()
173
coro = getstatusoutput(sys.executable, '-m', 'platform')
174
exitcode, stdout = loop.run_until_complete(coro)
175
if not exitcode:
0 commit comments