From f72167b0e0bb22ef84401ba6ee4c08cd8ada1754 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Wed, 7 Jun 2017 19:04:35 +0200 Subject: [PATCH] Fix one regression on more_tasks #1981 --- waflib/Runner.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/waflib/Runner.py b/waflib/Runner.py index 97b1825e..f270182d 100644 --- a/waflib/Runner.py +++ b/waflib/Runner.py @@ -213,8 +213,12 @@ class Parallel(object): def insert_with_prio(self, tsk): # TODO the deque interface has insert in python 3.5 :-/ - if self.outstanding and tsk.prio >= self.outstanding[0].prio: - self.outstanding.appendleft(tsk) + if self.outstanding: + try: + if tsk.prio >= self.outstanding[0].prio: + self.outstanding.appendleft(tsk) + except AttributeError: + self.outstanding.appendleft(tsk) else: self.outstanding.append(tsk) @@ -230,7 +234,7 @@ class Parallel(object): :type tsk: :py:attr:`waflib.Task.Task` """ if getattr(tsk, 'more_tasks', None): - ready, waiting = self.prio_and_split(tsk.tasks) + ready, waiting = self.prio_and_split(tsk.more_tasks) for k in ready: # TODO could be better, but we will have 1 task in general? self.insert_with_prio(k)