aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-29 13:43:29 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-29 13:46:49 -0800
commit6eb6500435c80837f106d3f9f9f6bb246ff00c16 (patch)
treea8601b5506fb2b1ae5f055402658a46cb9c5c169 /lib/_emerge
parentSpawnProcess: only cancel self._main_task if it's not done (diff)
downloadportage-6eb6500435c80837f106d3f9f9f6bb246ff00c16.tar.gz
portage-6eb6500435c80837f106d3f9f9f6bb246ff00c16.tar.bz2
portage-6eb6500435c80837f106d3f9f9f6bb246ff00c16.zip
SpawnProcess: make _main cancel pipe_logger when appropriate
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/SpawnProcess.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py
index aef000e22..941b56683 100644
--- a/lib/_emerge/SpawnProcess.py
+++ b/lib/_emerge/SpawnProcess.py
@@ -155,8 +155,13 @@ class SpawnProcess(SubProcess):
@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: