Use self.registered to return early from SubProcess.poll() when possible,
authorZac Medico <zmedico@gentoo.org>
Tue, 15 Jul 2008 02:49:31 +0000 (02:49 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 15 Jul 2008 02:49:31 +0000 (02:49 -0000)
and remove the related code from SequentialTaskQueue.schedule() since
this makes it obsolete.

svn path=/main/trunk/; revision=11052

pym/_emerge/__init__.py

index ef16f477c81feeaaebe9ab9bc9a3bbcc9c8e7302..7960872d55acf40afaa2e6f02d94084cf67a0dea 100644 (file)
@@ -1914,6 +1914,8 @@ class SubProcess(AsynchronousTask):
                        return self.returncode
                if self.pid is None:
                        return self.returncode
+               if self.registered:
+                       return self.returncode
 
                try:
                        retval = os.waitpid(self.pid, os.WNOHANG)
@@ -7993,8 +7995,6 @@ class SequentialTaskQueue(SlotObject):
                state_changed = False
 
                for task in list(running_tasks):
-                       if hasattr(task, "registered") and task.registered:
-                               continue
                        if task.poll() is not None:
                                state_changed = True