Browse Source

Always intialize the Task.request context.
Fixes failing test: tests.test_task.test_task.TestCeleryTasks.test_get_logger
(cherry picked from commit 50a33a2714cca8112323581299c1fac8f634ffa6)

Branko Čibej 14 years ago
parent
commit
8eeca0a1c7
1 changed files with 3 additions and 0 deletions
  1. 3 0
      celery/task/base.py

+ 3 - 0
celery/task/base.py

@@ -40,6 +40,9 @@ _default_context = {"logfile": None,
 
 class Context(threading.local):
 
+    def __init__(self):
+        self.update(_default_context)
+
     def update(self, d, **kwargs):
         self.__dict__.update(d, **kwargs)