merge trunk

This commit is contained in:
Todd Willey 2010-11-04 14:20:15 -04:00
commit 95b041ef2e

View File

@ -206,6 +206,7 @@ class DirectConsumer(Consumer):
self.routing_key = msg_id
self.exchange = msg_id
self.auto_delete = True
self.exclusive = True
super(DirectConsumer, self).__init__(connection=connection)
@ -262,6 +263,9 @@ def _unpack_context(msg):
"""Unpack context from msg."""
context_dict = {}
for key in list(msg.keys()):
# NOTE(vish): Some versions of python don't like unicode keys
# in kwargs.
key = str(key)
if key.startswith('_context_'):
value = msg.pop(key)
context_dict[key[9:]] = value