aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 2ac50c0..2448c6e 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -113,7 +113,7 @@ def encode_to_utf8(data):
if isinstance(data, bytes):
return data
elif isinstance(data, collections.Mapping):
- return dict(map(encode_to_utf8, data.iteritems()))
+ return type(data)(map(encode_to_utf8, data.iteritems()))
elif isinstance(data, collections.Iterable):
return type(data)(map(encode_to_utf8, data))
else:
@@ -126,7 +126,7 @@ def decode_from_utf8(data):
if isinstance(data, unicode):
return data
elif isinstance(data, collections.Mapping):
- return dict(map(decode_from_utf8, data.iteritems()))
+ return type(data)(map(decode_from_utf8, data.iteritems()))
elif isinstance(data, collections.Iterable):
return type(data)(map(decode_from_utf8, data))
else: