mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-05 01:53:01 +01:00
Remove the metaclass hierarchy in Python 2
This commit is contained in:
parent
1068ff98ec
commit
959d57b757
@ -109,7 +109,7 @@ class store_task_type(type):
|
||||
super(store_task_type, cls).__init__(name, bases, dict)
|
||||
name = cls.__name__
|
||||
|
||||
if name != 'evil' and name != 'Task':
|
||||
if name != 'Task':
|
||||
if getattr(cls, 'run_str', None):
|
||||
# if a string is provided, convert it to a method
|
||||
(f, dvars) = compile_fun(cls.run_str, cls.shell)
|
||||
|
@ -64,4 +64,4 @@ def r5(code):
|
||||
|
||||
@subst('Task.py')
|
||||
def r6(code):
|
||||
return code.replace('metaclass=store_task_type', "store_task_type('evil', (object,), {})")
|
||||
return code.replace('class Task(metaclass=store_task_type):', "class Task(object):%s\t__metaclass__=store_task_type" % os.linesep)
|
||||
|
Loading…
Reference in New Issue
Block a user