Remove all hooks when dumping data to JSON and Python 3 is used

This commit is contained in:
Ivan Kravets
2020-10-30 17:50:43 +02:00
parent 96b1a1c79c
commit 5cf73a9165

View File

@@ -98,7 +98,7 @@ if PY2:
if isinstance(obj, unicode):
return obj
return json.dumps(
obj, encoding=get_filesystem_encoding(), ensure_ascii=False, sort_keys=True
obj, encoding=get_filesystem_encoding(), ensure_ascii=False
).encode("utf8")
_magic_check = re.compile("([*?[])")
@@ -146,7 +146,7 @@ else:
def dump_json_to_unicode(obj):
if isinstance(obj, string_types):
return obj
return json.dumps(obj, ensure_ascii=False, sort_keys=True)
return json.dumps(obj)
def glob_recursive(pathname):
return glob.glob(pathname, recursive=True)