Explorar o código

subtask.apply* args, kwargs should be optional

Ask Solem %!s(int64=15) %!d(string=hai) anos
pai
achega
564f10530b
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      celery/task/sets.py

+ 2 - 2
celery/task/sets.py

@@ -77,7 +77,7 @@ class subtask(AttributeDict):
         """Shortcut to ``apply_async(argmerge, kwargs)``."""
         return self.apply_async(args=argmerge, kwargs=kwmerge)
 
-    def apply(self, args, kwargs, **options):
+    def apply(self, args=(), kwargs={}, **options):
         """Apply this task locally."""
         # For callbacks: extra args are prepended to the stored args.
         args = tuple(args) + tuple(self.args)
@@ -85,7 +85,7 @@ class subtask(AttributeDict):
         options = dict(self.options, **options)
         return self.get_type().apply(args, kwargs, options)
 
-    def apply_async(self, args, kwargs, **options):
+    def apply_async(self, args=(), kwargs={}, **options):
         """Apply this task asynchronously."""
         # For callbacks: extra args are prepended to the stored args.
         args = tuple(args) + tuple(self.args)