* [gentoo-commits] proj/portage:master commit in: pym/_emerge/
@ 2018-04-29 22:24 99% Zac Medico
0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2018-04-29 22:24 UTC (permalink / raw
To: gentoo-commits
commit: 4da425966a82bfbbb68908010995941a44b45598
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Sun Apr 29 21:39:28 2018 +0000
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Sun Apr 29 21:41:07 2018 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=4da42596
AbstractEbuildProcess: call_later asyncio compat (bug 591760)
Use call_later for asyncio compatibility.
Bug: https://bugs.gentoo.org/591760
pym/_emerge/AbstractEbuildProcess.py | 11 ++++-------
pym/_emerge/SubProcess.py | 2 +-
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/pym/_emerge/AbstractEbuildProcess.py b/pym/_emerge/AbstractEbuildProcess.py
index 2ed175750..ccc3b8e32 100644
--- a/pym/_emerge/AbstractEbuildProcess.py
+++ b/pym/_emerge/AbstractEbuildProcess.py
@@ -37,7 +37,7 @@ class AbstractEbuildProcess(SpawnProcess):
# doesn't hurt to be generous here since the scheduler
# continues to process events during this period, and it can
# return long before the timeout expires.
- _exit_timeout = 10000 # 10 seconds
+ _exit_timeout = 10 # seconds
# The EbuildIpcDaemon support is well tested, but this variable
# is left so we can temporarily disable it if any issues arise.
@@ -247,7 +247,7 @@ class AbstractEbuildProcess(SpawnProcess):
if self._registered:
# Let the process exit naturally, if possible.
self._exit_timeout_id = \
- self.scheduler.timeout_add(self._exit_timeout,
+ self.scheduler.call_later(self._exit_timeout,
self._exit_command_timeout_cb)
def _exit_command_timeout_cb(self):
@@ -258,17 +258,14 @@ class AbstractEbuildProcess(SpawnProcess):
# being killed by a signal.
self.cancel()
self._exit_timeout_id = \
- self.scheduler.timeout_add(self._cancel_timeout,
+ self.scheduler.call_later(self._cancel_timeout,
self._cancel_timeout_cb)
else:
self._exit_timeout_id = None
- return False # only run once
-
def _cancel_timeout_cb(self):
self._exit_timeout_id = None
self._async_waitpid()
- return False # only run once
def _orphan_process_warn(self):
phase = self.phase
@@ -363,7 +360,7 @@ class AbstractEbuildProcess(SpawnProcess):
SpawnProcess._async_waitpid_cb(self, *args, **kwargs)
if self._exit_timeout_id is not None:
- self.scheduler.source_remove(self._exit_timeout_id)
+ self._exit_timeout_id.cancel()
self._exit_timeout_id = None
if self._ipc_daemon is not None:
diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py
index aa4778737..a37482ca4 100644
--- a/pym/_emerge/SubProcess.py
+++ b/pym/_emerge/SubProcess.py
@@ -16,7 +16,7 @@ class SubProcess(AbstractPollTask):
# This is how much time we allow for waitpid to succeed after
# we've sent a kill signal to our subprocess.
- _cancel_timeout = 1000 # 1 second
+ _cancel_timeout = 1 # seconds
def _poll(self):
# Simply rely on _async_waitpid_cb to set the returncode.
^ permalink raw reply related [relevance 99%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2018-04-29 22:24 99% [gentoo-commits] proj/portage:master commit in: pym/_emerge/ Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox