aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2020-03-22 17:19:27 -0700
committerZac Medico <zmedico@gentoo.org>2020-03-22 17:41:36 -0700
commit21aea3df73497184c5c94fd6c69ebe23f3d214e9 (patch)
treee7527c8ae42abbd0efc236ceecea771cfea38331 /lib/_emerge/AsynchronousTask.py
parentAsynchronousTask: include self in InvalidStateError message (diff)
downloadportage-21aea3df73497184c5c94fd6c69ebe23f3d214e9.tar.gz
portage-21aea3df73497184c5c94fd6c69ebe23f3d214e9.tar.bz2
portage-21aea3df73497184c5c94fd6c69ebe23f3d214e9.zip
AsynchronousTask: in _async_wait, call self.wait() immediately
In _async_wait, call self.wait() immediately so that the stack trace for an InvalidStateError will contain useful debugging information. Since commit 46903f3e5622, exit listeners are invoked via call_soon, so it's no longer unecessary for _async_wait to invoke self.wait() via call_soon. Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'lib/_emerge/AsynchronousTask.py')
-rw-r--r--lib/_emerge/AsynchronousTask.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/_emerge/AsynchronousTask.py b/lib/_emerge/AsynchronousTask.py
index aaab7433a..c4197d468 100644
--- a/lib/_emerge/AsynchronousTask.py
+++ b/lib/_emerge/AsynchronousTask.py
@@ -109,13 +109,13 @@ class AsynchronousTask(SlotObject):
def _async_wait(self):
"""
- For cases where _start exits synchronously, this method is a
- convenient way to trigger an asynchronous call to self.wait()
- (in order to notify exit listeners), avoiding excessive event
- loop recursion (or stack overflow) that synchronous calling of
- exit listeners can cause. This method is thread-safe.
+ Subclasses call this method in order to invoke exit listeners when
+ self.returncode is set. Subclasses may override this method in order
+ to perform cleanup. The default implementation for this method simply
+ calls self.wait(), which will immediately raise an InvalidStateError
+ if the event loop is running and self.returncode is None.
"""
- self.scheduler.call_soon(self.wait)
+ self.wait()
def cancel(self):
"""