diff options
Diffstat (limited to 'Lib/asyncio/subprocess.py')
-rw-r--r-- | Lib/asyncio/subprocess.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/asyncio/subprocess.py b/Lib/asyncio/subprocess.py index fa58e1e..d34b611 100644 --- a/Lib/asyncio/subprocess.py +++ b/Lib/asyncio/subprocess.py @@ -26,6 +26,7 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, self._transport = None self._process_exited = False self._pipe_fds = [] + self._stdin_closed = self._loop.create_future() def __repr__(self): info = [self.__class__.__name__] @@ -80,6 +81,10 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, if pipe is not None: pipe.close() self.connection_lost(exc) + if exc is None: + self._stdin_closed.set_result(None) + else: + self._stdin_closed.set_exception(exc) return if fd == 1: reader = self.stdout @@ -106,6 +111,10 @@ class SubprocessStreamProtocol(streams.FlowControlMixin, self._transport.close() self._transport = None + def _get_close_waiter(self, stream): + if stream is self.stdin: + return self._stdin_closed + class Process: def __init__(self, transport, protocol, loop, *, _asyncio_internal=False): |