소스 검색

-A mod will now find any celery instance in the module

Ask Solem 12 년 전
부모
커밋
d20509692c
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      celery/bin/base.py

+ 4 - 0
celery/bin/base.py

@@ -407,6 +407,10 @@ class Command(object):
                 if getattr(sym, '__path__', None):
                     return self.find_app('{0}.celery:'.format(
                                          app.replace(':', '')))
+                from celery.app.base import Celery
+                for suspect in vars(sym).itervalues():
+                    if isinstance(suspect, Celery):
+                        return suspect
                 raise
         return sym