From: Zac Medico Date: Sat, 5 Jul 2008 23:17:01 +0000 (-0000) Subject: * Fix AsynchronousTask.poll() to call _wait_hook() when necessary. X-Git-Tag: v2.2_rc2~191 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c8ffb71fe978126ed9a3e7380bcd75e6daf44f7a;p=portage.git * Fix AsynchronousTask.poll() to call _wait_hook() when necessary. * Use the default poll() and cancel() implementations for BinpkgVerifier. svn path=/main/trunk/; revision=10947 --- 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")