Преглед на файлове

Task.update_state: meta should not default to {}, but None

Ask Solem преди 14 години
родител
ревизия
b5187b0d45
променени са 1 файла, в които са добавени 1 реда и са изтрити 3 реда
  1. 1 3
      celery/task/base.py

+ 1 - 3
celery/task/base.py

@@ -591,8 +591,6 @@ class BaseTask(object):
         :param meta: State metadata (:class:`dict`).
         :param meta: State metadata (:class:`dict`).
 
 
         """
         """
-        if meta is None:
-            meta = {}
         self.backend.store_result(task_id, meta, state)
         self.backend.store_result(task_id, meta, state)
 
 
     def on_retry(self, exc, task_id, args, kwargs, einfo=None):
     def on_retry(self, exc, task_id, args, kwargs, einfo=None):
@@ -681,7 +679,7 @@ class BaseTask(object):
         """repr(task)"""
         """repr(task)"""
         try:
         try:
             kind = self.__class__.mro()[1].__name__
             kind = self.__class__.mro()[1].__name__
-        except (AttributeError, IndexError):
+        except (AttributeError, IndexError):            # pragma: no cover
             kind = "%s(Task)" % self.__class__.__name__
             kind = "%s(Task)" % self.__class__.__name__
         return "<%s: %s (%s)>" % (kind, self.name, self.type)
         return "<%s: %s (%s)>" % (kind, self.name, self.type)