From c8ffb71fe978126ed9a3e7380bcd75e6daf44f7a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 5 Jul 2008 23:17:01 +0000 Subject: [PATCH] * Fix AsynchronousTask.poll() to call _wait_hook() when necessary. * Use the default poll() and cancel() implementations for BinpkgVerifier. svn path=/main/trunk/; revision=10947 --- pym/_emerge/__init__.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index d25358faa..0665701f7 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1467,6 +1467,8 @@ class AsynchronousTask(SlotObject): return self.returncode is None def poll(self): + if self.returncode is not None: + self._wait_hook() return self.returncode def wait(self): @@ -1474,7 +1476,8 @@ class AsynchronousTask(SlotObject): return self.returncode def cancel(self): - pass + self.cancelled = True + self.wait() def addExitListener(self, f): """ @@ -2619,12 +2622,6 @@ class BinpkgVerifier(AsynchronousTask): self.returncode = rval - def cancel(self): - self.cancelled = True - - def poll(self): - return self.returncode - class BinpkgExtractorAsync(SpawnProcess): __slots__ = ("image_dir", "pkg", "pkg_path") -- 2.26.2