1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Python 3: don't convert unicode to unicode

This commit is contained in:
Marius Gedminas 2015-09-30 09:10:18 +03:00
parent c7be004c19
commit 213029a21e

View file

@ -323,7 +323,7 @@ def json_dict_bytes_to_unicode(d, encoding='utf-8'):
and dict container types (the containers that the json module returns)
'''
if isinstance(d, str):
if isinstance(d, bytes):
return unicode(d, encoding)
elif isinstance(d, dict):
return dict(imap(json_dict_bytes_to_unicode, iteritems(d), repeat(encoding)))