Browse Source

find_app: Handle import error from proj.celery:

Ask Solem 12 years ago
parent
commit
ee682dd35b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      celery/bin/base.py

+ 5 - 2
celery/bin/base.py

@@ -440,8 +440,11 @@ class Command(object):
                 return sym.celery
             except AttributeError:
                 if getattr(sym, '__path__', None):
-                    return self.find_app('{0}.celery:'.format(
-                                         app.replace(':', '')))
+                    try:
+                        return self.find_app('{0}.celery:'.format(
+                                             app.replace(':', '')))
+                    except ImportError:
+                        pass
                 from celery.app.base import Celery
                 for suspect in values(vars(sym)):
                     if isinstance(suspect, Celery):