我正在使用:Python 3.5,Celery 4.0.2
Celery网站的示例代码:
class CustomTask(Task):
def run(self):
print('running')
CustomTask = celery_app.register_task(CustomTask())
@celery_app.task(bind=True, base=CustomTask)
def custom(self):
print('running')
stacktrace的一部分:
celery_app.task(bind=True, base=CustomTask)
File "/home/xxx/Projects/nn/venv/lib/python3.5/site-packages/celery/app/base.py", line 416, in _create_task_cls
ret = self._task_from_fun(fun, **opts)
File "/home/xxx/Projects/nn/venv/lib/python3.5/site-packages/celery/app/base.py", line 454, in _task_from_fun
'wrapped': run}, **options))()
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
我做错了吗?