Skip to content

Commit

Permalink
AsynchronousTask: Call _start_hook after _start_async
Browse files Browse the repository at this point in the history
The start listeners need to run after _start_async has
completed in case they rely on any state that _start_async
has created (same goes for _start).

Fixes: d66e9ec ("AsynchronousTask: add coroutine async_start method")
Signed-off-by: Zac Medico <zmedico@gentoo.org>
  • Loading branch information
zmedico committed Feb 18, 2020
1 parent c7e52d0 commit 036c644
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/_emerge/AsynchronousTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ class AsynchronousTask(SlotObject):

@coroutine
def async_start(self):
self._start_hook()
yield self._async_start()
self._start_hook()

@coroutine
def _async_start(self):
Expand All @@ -38,8 +38,8 @@ def start(self):
"""
Start an asynchronous task and then return as soon as possible.
"""
self._start_hook()
self._start()
self._start_hook()

def _start(self):
self.returncode = os.EX_OK
Expand Down

0 comments on commit 036c644

Please sign in to comment.