commit:     ae59758e395393601a389ede4f4b521db6786139
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Thu Apr 12 08:25:17 2018 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Thu Apr 12 08:30:49 2018 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ae59758e

ForkExecutor: fix shutdown to handle empty self._running_tasks

 pym/portage/util/futures/executor/fork.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pym/portage/util/futures/executor/fork.py 
b/pym/portage/util/futures/executor/fork.py
index 919a72bfd..51367f934 100644
--- a/pym/portage/util/futures/executor/fork.py
+++ b/pym/portage/util/futures/executor/fork.py
@@ -96,6 +96,8 @@ class ForkExecutor(object):
 
        def shutdown(self, wait=True):
                self._shutdown = True
+               if not self._running_tasks and not self._shutdown_future.done():
+                       self._shutdown_future.set_result(None)
                if wait:
                        self._loop.run_until_complete(self._shutdown_future)
 

Reply via email to