2
0
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:
Thomas Nagy 2019-10-18 23:02:19 +02:00
parent 1068ff98ec
commit 959d57b757
No known key found for this signature in database
GPG Key ID: 49B4C67C05277AAA
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)