aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-02-29 14:38:35 -0800
committerZac Medico <zmedico@gentoo.org>2020-02-29 14:43:51 -0800
commitd331f03ab25422e9afc2e752ea8e39c93a4b0bec (patch)
tree41d29462903431dd1473d341eefe6470ad9391dd /lib
parentSpawnProcess: make _main cancel pipe_logger when appropriate (diff)
downloadportage-d331f03ab25422e9afc2e752ea8e39c93a4b0bec.tar.gz
portage-d331f03ab25422e9afc2e752ea8e39c93a4b0bec.tar.bz2
portage-d331f03ab25422e9afc2e752ea8e39c93a4b0bec.zip
SpawnProcess: cancel pipe_logger after async_start CancelledError
Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/_emerge/SpawnProcess.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py
index 941b56683..ab7971ca8 100644
--- a/lib/_emerge/SpawnProcess.py
+++ b/lib/_emerge/SpawnProcess.py
@@ -147,7 +147,12 @@ class SpawnProcess(SubProcess):
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)