Skip to content
Snippets Groups Projects
Commit f0a16d2a authored by Ayub khan's avatar Ayub khan
Browse files

BOM-455

python3 compatibility
parent 89c57a63
No related branches found
No related tags found
No related merge requests found
......@@ -69,12 +69,8 @@ def dump_js_escaped_json(obj, cls=EdxJSONEncoder):
(string) Escaped encoded JSON.
"""
try:
json_string = json.dumps(obj, ensure_ascii=True, cls=cls)
except: # pylint: disable=bare-except
# in some cases dict_values appear here.
json_string = json.dumps(list(obj), ensure_ascii=True, cls=cls)
obj = list(obj) if isinstance(obj, type({}.values())) else obj
json_string = json.dumps(obj, ensure_ascii=True, cls=cls)
json_string = _escape_json_for_js(json_string)
return json_string
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment