make sure context keys are not unicode so they can be passed as kwargs

This commit is contained in:
Vishvananda Ishaya
2010-11-03 14:59:35 -07:00
parent 27b55e0c58
commit dccd1ee567

View File

@@ -262,6 +262,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