mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
asyncio: BaseSubprocessTransport.close() doesn't try to kill the process if it
already finished
This commit is contained in:
parent
832dd5f0d6
commit
8e36812e27
2 changed files with 61 additions and 1 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue