aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-03-06 00:11:05 -0800
committerZac Medico <zmedico@gentoo.org>2020-03-06 00:55:17 -0800
commit5d476c4e500248929d6b042de302b1e7c923dc60 (patch)
treea7d0d91eb757411c4550171a4b16daf1f8182a53 /lib/_emerge
parentScheduler: replace add_done_callback with addExitListener (diff)
downloadportage-5d476c4e500248929d6b042de302b1e7c923dc60.tar.gz
portage-5d476c4e500248929d6b042de302b1e7c923dc60.tar.bz2
portage-5d476c4e500248929d6b042de302b1e7c923dc60.zip
AsynchronousTask: handle addExistListener after exit
When addExistListener is called after the task has already exited with a returncode, immediately schedule the listener to be invoked via call_soon. This behavior is similar to the Future add_done_callback method. Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge')
-rw-r--r--lib/_emerge/AsynchronousTask.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/_emerge/AsynchronousTask.py b/lib/_emerge/AsynchronousTask.py
index 799e66a4a..97db02587 100644
--- a/lib/_emerge/AsynchronousTask.py
+++ b/lib/_emerge/AsynchronousTask.py
@@ -176,6 +176,8 @@ class AsynchronousTask(SlotObject):
if self._exit_listeners is None:
self._exit_listeners = []
self._exit_listeners.append(f)
+ if self.returncode is not None:
+ self._wait_hook()
def removeExitListener(self, f):
if self._exit_listeners is not None: