Use a normal list instead of a deque for Scheduler._pkg_queue since deque
authorZac Medico <zmedico@gentoo.org>
Tue, 8 Jul 2008 10:28:43 +0000 (10:28 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 8 Jul 2008 10:28:43 +0000 (10:28 -0000)
doesn't have a remove() method until python-2.5.

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

pym/_emerge/__init__.py

index 8d7a925d7f20e321d26aaab201b2024d7ffbb85c..66f5ce4eef3ca684db13b934a8b9e1d78e37e17d 100644 (file)
@@ -7642,7 +7642,7 @@ class Scheduler(object):
 
                self._add_task = self._task_queues.prefetch.add
                self._prefetchers = weakref.WeakValueDictionary()
-               self._pkg_queue = deque()
+               self._pkg_queue = []
                self._completed_tasks = set()
                self._failed_pkgs = []
                self._failed_fetches = []
@@ -8073,7 +8073,7 @@ class Scheduler(object):
                        self._main_loop()
                finally:
                        # discard remaining packages if necessary
-                       pkg_queue.clear()
+                       del pkg_queue[:]
                        self._completed_tasks.clear()
                        self._digraph = None
                        self._task_queues.prefetch.clear()
@@ -8089,7 +8089,7 @@ class Scheduler(object):
 
        def _choose_pkg(self):
                if self._max_jobs < 2:
-                       return self._pkg_queue.popleft()
+                       return self._pkg_queue.pop(0)
 
                self._prune_digraph()