diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2015-02-10 14:49:32 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2015-02-10 14:49:32 +0100 |
commit | f986a829a66a27e3e6e9d5695aad159b7cec0c9d (patch) | |
tree | 59c18c70562b0ea805f62e1c85728719f33784af /Lib/asyncio/base_subprocess.py | |
parent | 8b32fceb24943d8adfa8de7294391f3f52eded54 (diff) | |
download | cpython-f986a829a66a27e3e6e9d5695aad159b7cec0c9d.tar.gz |
asyncio: BaseSubprocessTransport.close() doesn't try to kill the process if it
already finished
Diffstat (limited to 'Lib/asyncio/base_subprocess.py')
-rw-r--r-- | Lib/asyncio/base_subprocess.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py index 02b9e89f70..5458ab154c 100644 --- a/Lib/asyncio/base_subprocess.py +++ b/Lib/asyncio/base_subprocess.py @@ -93,7 +93,12 @@ class BaseSubprocessTransport(transports.SubprocessTransport): continue proto.pipe.close() - if self._proc is not None and self._returncode is None: + if (self._proc is not None + # the child process finished? + and self._returncode is None + # the child process finished but the transport was not notified yet? + and self._proc.poll() is None + ): if self._loop.get_debug(): logger.warning('Close running child process: kill %r', self) |