diff --git a/ChangeLog b/ChangeLog index a086f746..c160d056 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +- Remove waflib.Runner.PriorityTasks.appendleft +- Remove waflib.Task.TaskBase +- Remove the upper class of waflib.Task.Task (metaclasses) + NEW IN WAF 2.0.19 ----------------- * Fix negative values for -j #2256 diff --git a/TODO b/TODO index 1392725b..02e75354 100644 --- a/TODO +++ b/TODO @@ -5,8 +5,5 @@ Waf 2.1 - Fix the circular imports ccroot<->c_config.py - Remove superfluous *k in ctx.load() and other unused parameters Ensure conf.load() has the same interface as ctx.load() -- Remove waflib.Runner.PriorityTasks.appendleft -- Remove waflib.Task.TaskBase -- Remove the upper class of waflib.Task.Task (metaclasses) - Ordered_iter_dict in python 3.7 - Change _add_task to add_task in Runner.py diff --git a/waf-light b/waf-light index 713170e0..15204942 100755 --- a/waf-light +++ b/waf-light @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: latin-1 # Thomas Nagy, 2005-2018 # diff --git a/waflib/Runner.py b/waflib/Runner.py index 91d55479..998f57d5 100644 --- a/waflib/Runner.py +++ b/waflib/Runner.py @@ -43,9 +43,6 @@ class PriorityTasks(object): self.lst = [] def append(self, task): heapq.heappush(self.lst, task) - def appendleft(self, task): - "Deprecated, do not use" - heapq.heappush(self.lst, task) def pop(self): return heapq.heappop(self.lst) def extend(self, lst): diff --git a/waflib/Task.py b/waflib/Task.py index cb49a739..035fe77e 100644 --- a/waflib/Task.py +++ b/waflib/Task.py @@ -132,10 +132,7 @@ class store_task_type(type): # be creative getattr(cls, 'register', classes)[name] = cls -evil = store_task_type('evil', (object,), {}) -"Base class provided to avoid writing a metaclass, so the code can run in python 2.6 and 3.x unmodified" - -class Task(evil): +class Task(metaclass=store_task_type): """ Task objects represents actions to perform such as commands to execute by calling the `run` method. @@ -1350,9 +1347,6 @@ def deep_inputs(cls): cls.sig_explicit_deps = sig_explicit_deps return cls -TaskBase = Task -"Provided for compatibility reasons, TaskBase should not be used" - class TaskSemaphore(object): """ Task semaphores provide a simple and efficient way of throttling the amount of diff --git a/waflib/fixpy2.py b/waflib/fixpy2.py index 24176e06..5be62e1d 100644 --- a/waflib/fixpy2.py +++ b/waflib/fixpy2.py @@ -62,3 +62,6 @@ def r4(code): def r5(code): return code.replace("('Execution failure: %s'%str(e),ex=e)", "('Execution failure: %s'%str(e),ex=e),None,sys.exc_info()[2]") +@subst('Task.py') +def r6(code): + return code.replace('metaclass=store_task_type', "store_task_type('evil', (object,), {})")