Преглед изворни кода

Remove use of kwdict workaround fixed in py2.7

Ask Solem пре 11 година
родитељ
комит
3ff387099d
2 измењених фајлова са 7 додато и 7 уклоњено
  1. 6 6
      celery/canvas.py
  2. 1 1
      celery/utils/__init__.py

+ 6 - 6
celery/canvas.py

@@ -18,7 +18,7 @@ from functools import partial as _partial, reduce
 from operator import itemgetter
 from itertools import chain as _chain
 
-from kombu.utils import cached_property, fxrange, kwdict, reprcall, uuid
+from kombu.utils import cached_property, fxrange, reprcall, uuid
 
 from celery._state import current_app, get_current_worker_task
 from celery.utils.functional import (
@@ -133,7 +133,7 @@ class Signature(dict):
     def from_dict(self, d, app=None):
         typ = d.get('subtask_type')
         if typ:
-            return self.TYPES[typ].from_dict(kwdict(d), app=app)
+            return self.TYPES[typ].from_dict(d, app=app)
         return Signature(d, app=app)
 
     def __init__(self, task=None, args=None, kwargs=None, options=None,
@@ -449,7 +449,7 @@ class chain(Signature):
         if d['args'] and tasks:
             # partial args passed on to first task in chain (Issue #1057).
             tasks[0]['args'] = tasks[0]._merge(d['args'])[0]
-        return chain(*d['kwargs']['tasks'], app=app, **kwdict(d['options']))
+        return chain(*d['kwargs']['tasks'], app=app, **d['options'])
 
     @property
     def app(self):
@@ -568,7 +568,7 @@ class group(Signature):
             # partial args passed on to all tasks in the group (Issue #1057).
             for task in tasks:
                 task['args'] = task._merge(d['args'])[0]
-        return group(tasks, app=app, **kwdict(d['options']))
+        return group(tasks, app=app, **d['options'])
 
     def _prepared(self, tasks, partial_args, group_id, root_id, dict=dict,
                   Signature=Signature, from_dict=Signature.from_dict):
@@ -707,8 +707,8 @@ class chord(Signature):
 
     @classmethod
     def from_dict(self, d, app=None):
-        args, d['kwargs'] = self._unpack_args(**kwdict(d['kwargs']))
-        return self(*args, app=app, **kwdict(d))
+        args, d['kwargs'] = self._unpack_args(**d['kwargs'])
+        return self(*args, app=app, **d)
 
     @staticmethod
     def _unpack_args(header=None, body=None, **kwargs):

+ 1 - 1
celery/utils/__init__.py

@@ -386,5 +386,5 @@ from .imports import (          # noqa
     instantiate, import_from_cwd
 )
 from .functional import chunks, noop                    # noqa
-from kombu.utils import cached_property, kwdict, uuid   # noqa
+from kombu.utils import cached_property, uuid   # noqa
 gen_unique_id = uuid