AsynchronousLock: check type in _poll and _cancel
authorZac Medico <zmedico@gentoo.org>
Thu, 26 May 2011 22:14:07 +0000 (15:14 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 26 May 2011 22:14:07 +0000 (15:14 -0700)
pym/_emerge/AsynchronousLock.py

index d11797993233b1f6eafe609ab407a0b703e69fe7..debf15302e5c68dca3412b0a02467aff91aeace4 100644 (file)
@@ -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):