浏览代码

Fixes bug in non-abstract tasks when inheriting app

Ask Solem 11 年之前
父节点
当前提交
3c6670d11e
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      celery/app/task.py

+ 3 - 1
celery/app/task.py

@@ -153,9 +153,11 @@ class TaskType(type):
         # in the '_app' attribute.  Previously this was a regular attribute,
         # in the '_app' attribute.  Previously this was a regular attribute,
         # so we should support classes defining it.
         # so we should support classes defining it.
         app = attrs.pop('_app', None) or attrs.pop('app', None)
         app = attrs.pop('_app', None) or attrs.pop('app', None)
+
+        # Attempt to inherit app from one the bases
         if not isinstance(app, Proxy) and app is None:
         if not isinstance(app, Proxy) and app is None:
             for base in bases:
             for base in bases:
-                if base._app:
+                if getattr(base, '_app', None):
                     app = base._app
                     app = base._app
                     break
                     break
             else:
             else: