[PATCH] do not open-code task_pending()



Reuse the task_pending() code instead of open-coding it.

-- 
Vincent Legoll
Index: task.py
===================================================================
--- task.py	(revision 1266)
+++ task.py	(working copy)
@@ -103,14 +103,14 @@
             r = self.iteration()
             if r:
                 return r
-        return len(self.tasks) != 0
+        return self.tasks_pending()
 
     def complete_tasks(self):
         """Run all currently added tasks to completion.
 
         Tasks added after the call to complete_tasks are not run.
         """
-        while len(self.tasks):
+        while self.tasks_pending():
             self.iteration()
         
     def tasks_pending(self):


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]