commit:     6eb6500435c80837f106d3f9f9f6bb246ff00c16
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 29 21:43:29 2020 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat Feb 29 21:46:49 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=6eb65004

SpawnProcess: make _main cancel pipe_logger when appropriate

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/SpawnProcess.py | 9 +++++++--
 1 file 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:

Reply via email to