Ask Solem 10 年 前
コミット
2abc5dec22
3 ファイル変更6 行追加10 行削除
  1. 4 4
      celery/app/task.py
  2. 1 5
      celery/bin/base.py
  3. 1 1
      celery/tests/fixups/test_django.py

+ 4 - 4
celery/app/task.py

@@ -532,10 +532,10 @@ class Task(object):
             attribute.  Trailing can also be disabled by default using the
             :attr:`trail` attribute
         :keyword publisher: Deprecated alias to ``producer``.
-        
-        :rtype :class:`celery.result.AsyncResult`: if 
-            :setting:`CELERY_ALWAYS_EAGER` is not set, otherwise 
-            :class:`celery.result.EagerResult`:
+
+        :rtype :class:`celery.result.AsyncResult`: if
+            :setting:`CELERY_ALWAYS_EAGER` is not set, otherwise
+            :class:`celery.result.EagerResult`.
 
         Also supports all keyword arguments supported by
         :meth:`kombu.Producer.publish`.

+ 1 - 5
celery/bin/base.py

@@ -505,11 +505,7 @@ class Command(object):
         return self.preparse_options(args, self.preload_options)
 
     def add_append_opt(self, acc, opt, value):
-        default = opt.default or []
-
-        if opt.dest not in acc:
-           acc[opt.dest] = default
-
+        acc.setdefault(opt.dest, opt.default or [])
         acc[opt.dest].append(value)
 
     def preparse_options(self, args, options):

+ 1 - 1
celery/tests/fixups/test_django.py

@@ -209,7 +209,7 @@ class test_DjangoWorkerFixup(FixupCase):
             conns[1].close.side_effect = KeyError('already closed')
             f.database_errors = (KeyError, )
 
-            f._db.connections = Mock() # ConnectionHandler
+            f._db.connections = Mock()  # ConnectionHandler
             f._db.connections.all.side_effect = lambda: conns
 
             f._close_database()