From: Zac Medico Date: Thu, 26 May 2011 22:14:07 +0000 (-0700) Subject: AsynchronousLock: check type in _poll and _cancel X-Git-Tag: v2.2.0_alpha37~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e0c79d23399998114284e9f6245e812b8df57474;p=portage.git AsynchronousLock: check type in _poll and _cancel --- diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py index d11797993..debf15302 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -70,12 +70,12 @@ class AsynchronousLock(AsynchronousTask): self.wait() def _cancel(self): - if self._imp is not None: + if isinstance(self._imp, AsynchronousTask): self._imp.cancel() def _poll(self): - if self._imp is not None: - return self._imp.poll() + if isinstance(self._imp, AsynchronousTask): + self._imp.poll() return self.returncode def _wait(self):