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 | 8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e (patch) | |
| tree | ed88c714f3995dd3e85e3f8fef26097e04a6e285 /Lib/asyncio/base_subprocess.py | |
| parent | 832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (diff) | |
| download | cpython-git-8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e.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) |
