summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-02-10 13:49:32 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-02-10 13:49:32 (GMT)
commit8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e (patch)
treeed88c714f3995dd3e85e3f8fef26097e04a6e285 /Lib/asyncio
parent832dd5f0d65d3a0ebd7d7c7a3a4c80ab5170cd08 (diff)
downloadcpython-8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e.zip
cpython-8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e.tar.gz
cpython-8e36812e27f70bd6e4b3b85c9e9e858b0ac0df5e.tar.bz2
asyncio: BaseSubprocessTransport.close() doesn't try to kill the process if it
already finished
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_subprocess.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/base_subprocess.py b/Lib/asyncio/base_subprocess.py
index 02b9e89..5458ab1 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)