This is needed in order to ensure that exit listeners are called.
Subclasses call the base class cancel() method in order to inherit the
wait() call.
-# Copyright 1999-2009 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from _emerge.AsynchronousTask import AsynchronousTask
self.cancelled = True
if self._current_task is not None:
self._current_task.cancel()
+ AsynchronousTask.cancel(self)
def _poll(self):
"""
-# Copyright 2010 Gentoo Foundation
+# Copyright 2010-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage import os
self.returncode = 1
self.cancelled = True
self._unregister()
- self.wait()
+ AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
-# Copyright 1999-2010 Gentoo Foundation
+# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
from portage import os
if self.returncode is None:
self.returncode = 1
self.cancelled = True
- self.wait()
+ AbstractPollTask.cancel(self)
def _wait(self):
if self.returncode is not None:
if e.errno != errno.ESRCH:
raise
del e
-
- self.cancelled = True
- if self.pid is not None:
- self.wait()
- return self.returncode
+ AbstractPollTask.cancel(self)
def isAlive(self):
return self.pid is not None and \