Skip to content

Commit

Permalink
SpawnProcess: cancel pipe_logger after async_start CancelledError
Browse files Browse the repository at this point in the history
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Feb 29, 2020
1 parent 6eb6500 commit d331f03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/_emerge/SpawnProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ def _async_start(self):
log_file_path=log_file_path,
stdout_fd=stdout_fd)
self._registered = True
yield pipe_logger.async_start()
try:
yield pipe_logger.async_start()
except asyncio.CancelledError:
if pipe_logger.poll() is None:
pipe_logger.cancel()
raise

self._main_task = asyncio.ensure_future(
self._main(pipe_logger), loop=self.scheduler)
Expand Down

0 comments on commit d331f03

Please sign in to comment.