Skip to content

Commit

Permalink
SpawnProcess: make _main cancel pipe_logger when appropriate
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 10cc6fe commit 6eb6500
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/_emerge/SpawnProcess.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,13 @@ def _async_start(self):

@coroutine
def _main(self, pipe_logger):
if pipe_logger.poll() is None:
yield pipe_logger.async_wait()
try:
if pipe_logger.poll() is None:
yield pipe_logger.async_wait()
except asyncio.CancelledError:
if pipe_logger.poll() is None:
pipe_logger.cancel()
raise

def _main_exit(self, main_task):
try:
Expand Down

0 comments on commit 6eb6500

Please sign in to comment.