mirror of
https://github.com/platformio/platformio-core.git
synced 2025-08-02 03:14:26 +02:00
Remove all hooks when dumping data to JSON and Python 3 is used
This commit is contained in:
@@ -98,7 +98,7 @@ if PY2:
|
|||||||
if isinstance(obj, unicode):
|
if isinstance(obj, unicode):
|
||||||
return obj
|
return obj
|
||||||
return json.dumps(
|
return json.dumps(
|
||||||
obj, encoding=get_filesystem_encoding(), ensure_ascii=False, sort_keys=True
|
obj, encoding=get_filesystem_encoding(), ensure_ascii=False
|
||||||
).encode("utf8")
|
).encode("utf8")
|
||||||
|
|
||||||
_magic_check = re.compile("([*?[])")
|
_magic_check = re.compile("([*?[])")
|
||||||
@@ -146,7 +146,7 @@ else:
|
|||||||
def dump_json_to_unicode(obj):
|
def dump_json_to_unicode(obj):
|
||||||
if isinstance(obj, string_types):
|
if isinstance(obj, string_types):
|
||||||
return obj
|
return obj
|
||||||
return json.dumps(obj, ensure_ascii=False, sort_keys=True)
|
return json.dumps(obj)
|
||||||
|
|
||||||
def glob_recursive(pathname):
|
def glob_recursive(pathname):
|
||||||
return glob.glob(pathname, recursive=True)
|
return glob.glob(pathname, recursive=True)
|
||||||
|
Reference in New Issue
Block a user