Gentoo Archives: gentoo-commits

From: Zac Medico <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: lib/_emerge/
Date: Sat, 29 Feb 2020 21:49:01
Message-Id: 1583012809.6eb6500435c80837f106d3f9f9f6bb246ff00c16.zmedico@gentoo
1 commit: 6eb6500435c80837f106d3f9f9f6bb246ff00c16
2 Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 29 21:43:29 2020 +0000
4 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 29 21:46:49 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=6eb65004
7
8 SpawnProcess: make _main cancel pipe_logger when appropriate
9
10 Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>
11
12 lib/_emerge/SpawnProcess.py | 9 +++++++--
13 1 file changed, 7 insertions(+), 2 deletions(-)
14
15 diff --git a/lib/_emerge/SpawnProcess.py b/lib/_emerge/SpawnProcess.py
16 index aef000e22..941b56683 100644
17 --- a/lib/_emerge/SpawnProcess.py
18 +++ b/lib/_emerge/SpawnProcess.py
19 @@ -155,8 +155,13 @@ class SpawnProcess(SubProcess):
20
21 @coroutine
22 def _main(self, pipe_logger):
23 - if pipe_logger.poll() is None:
24 - yield pipe_logger.async_wait()
25 + try:
26 + if pipe_logger.poll() is None:
27 + yield pipe_logger.async_wait()
28 + except asyncio.CancelledError:
29 + if pipe_logger.poll() is None:
30 + pipe_logger.cancel()
31 + raise
32
33 def _main_exit(self, main_task):
34 try: