Scheduler: fix AttributeError in _terminate_tasks
authorZac Medico <zmedico@gentoo.org>
Sat, 12 Mar 2011 18:35:23 +0000 (10:35 -0800)
committerZac Medico <zmedico@gentoo.org>
Mon, 14 Mar 2011 16:24:23 +0000 (09:24 -0700)
Thanks to David James <davidjames@google.com> for reporting this error:
AttributeError: 'EbuildPhase' object has no attribute 'merge'

pym/_emerge/Scheduler.py

index 2f49c34209a823ecf3f4f32a5bd6751013526934..de635b2b38eab0e18f926ae5ac68592672879867 100644 (file)
@@ -301,7 +301,10 @@ class Scheduler(PollScheduler):
                for build in self._task_queues.jobs._task_queue:
                        self._running_tasks.remove(build.pkg)
                for merge in self._task_queues.merge._task_queue:
-                       self._running_tasks.remove(merge.merge.pkg)
+                       # Setup phases may be scheduled in this queue, but
+                       # we're only interested in the PackageMerge instances.
+                       if isinstance(merge, PackageMerge):
+                               self._running_tasks.remove(merge.merge.pkg)
                for q in self._task_queues.values():
                        q.clear()