Browse Source

EventReceiver.handler shouldn't use global default

Ask Solem 12 years ago
parent
commit
2e4624410f
1 changed files with 1 additions and 3 deletions
  1. 1 3
      celery/events/__init__.py

+ 1 - 3
celery/events/__init__.py

@@ -165,14 +165,12 @@ class EventReceiver(ConsumerMixin):
     handler.
     handler.
 
 
     """
     """
-    handlers = {}
 
 
     def __init__(self, connection, handlers=None, routing_key='#',
     def __init__(self, connection, handlers=None, routing_key='#',
             node_id=None, app=None, queue_prefix='celeryev'):
             node_id=None, app=None, queue_prefix='celeryev'):
         self.app = app_or_default(app)
         self.app = app_or_default(app)
         self.connection = connection
         self.connection = connection
-        if handlers is not None:
-            self.handlers = handlers
+        self.handlers = {} if handlers is None else handlers
         self.routing_key = routing_key
         self.routing_key = routing_key
         self.node_id = node_id or uuid()
         self.node_id = node_id or uuid()
         self.queue_prefix = queue_prefix
         self.queue_prefix = queue_prefix