commit:     1eda52d380b39095c6471db8025ab2202fedafc9
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sat May  1 22:23:39 2021 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sat May  1 22:27:41 2021 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=1eda52d3

_run_pkg_pretend: raise asyncio.CancelledError when terminated

Bug: https://bugs.gentoo.org/787545
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/_emerge/Scheduler.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/_emerge/Scheduler.py b/lib/_emerge/Scheduler.py
index 0ed2ee530..656d382dd 100644
--- a/lib/_emerge/Scheduler.py
+++ b/lib/_emerge/Scheduler.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from collections import deque
@@ -791,6 +791,10 @@ class Scheduler(PollScheduler):
                        if "pretend" not in x.defined_phases:
                                continue
 
+                       self._termination_check()
+                       if self._terminated_tasks:
+                               raise asyncio.CancelledError
+
                        out_str = "Running pre-merge checks for " + 
colorize("INFORM", x.cpv)
                        self._status_msg(out_str)
 

Reply via email to