Kaydet (Commit) 2f156457 authored tarafından Yury Selivanov's avatar Yury Selivanov

asyncio: Fix trailing whitespace/code style

üst 481cb70a
...@@ -89,7 +89,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, ...@@ -89,7 +89,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
reader.feed_eof() reader.feed_eof()
else: else:
reader.set_exception(exc) reader.set_exception(exc)
if fd in self._pipe_fds: if fd in self._pipe_fds:
self._pipe_fds.remove(fd) self._pipe_fds.remove(fd)
self._maybe_close_transport() self._maybe_close_transport()
...@@ -97,7 +97,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, ...@@ -97,7 +97,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin,
def process_exited(self): def process_exited(self):
self._process_exited = True self._process_exited = True
self._maybe_close_transport() self._maybe_close_transport()
def _maybe_close_transport(self): def _maybe_close_transport(self):
if len(self._pipe_fds) == 0 and self._process_exited: if len(self._pipe_fds) == 0 and self._process_exited:
self._transport.close() self._transport.close()
......
...@@ -468,9 +468,11 @@ class SubprocessMixin: ...@@ -468,9 +468,11 @@ class SubprocessMixin:
'sys.stdout.flush()', 'sys.stdout.flush()',
'sys.exit(1)']) 'sys.exit(1)'])
fut = asyncio.create_subprocess_exec(sys.executable, '-c', code, fut = asyncio.create_subprocess_exec(
stdout=asyncio.subprocess.PIPE, sys.executable, '-c', code,
loop=self.loop) stdout=asyncio.subprocess.PIPE,
loop=self.loop)
process = yield from fut process = yield from fut
while True: while True:
data = yield from process.stdout.read(65536) data = yield from process.stdout.read(65536)
...@@ -480,7 +482,7 @@ class SubprocessMixin: ...@@ -480,7 +482,7 @@ class SubprocessMixin:
break break
self.loop.run_until_complete(execute()) self.loop.run_until_complete(execute())
if sys.platform != 'win32': if sys.platform != 'win32':
# Unix # Unix
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment