This reverts commit 2365e2e8cf.
This commit is contained in:
1 parent
ceb3985a99
commit
7d8da47309
7 files changed
+6
-14
No files matched your search
@@ -6,8 +6,6 @@ import os
|
||||
import tempfile
|
||||
from typing import Any, Dict, List, Optional, Type, Union
|
||||
|
||||
import orjson
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
@@ -30,7 +28,7 @@ def load_json(
|
||||
"""
|
||||
try:
|
||||
with open(filename, encoding="utf-8") as fdesc:
|
||||
return orjson.loads(fdesc.read()) # type: ignore
|
||||
return json.loads(fdesc.read()) # type: ignore
|
||||
except FileNotFoundError:
|
||||
# This is not a fatal error
|
||||
_LOGGER.debug("JSON file not found: %s", filename)
|
||||
@@ -99,7 +97,7 @@ def find_paths_unserializable_data(bad_data: Any) -> List[str]:
|
||||
obj, obj_path = to_process.popleft()
|
||||
|
||||
try:
|
||||
orjson.dumps(obj)
|
||||
json.dumps(obj)
|
||||
continue
|
||||
except TypeError:
|
||||
pass
|
||||
@@ -108,7 +106,7 @@ def find_paths_unserializable_data(bad_data: Any) -> List[str]:
|
||||
for key, value in obj.items():
|
||||
try:
|
||||
# Is key valid?
|
||||
orjson.dumps({key: None})
|
||||
json.dumps({key: None})
|
||||
except TypeError:
|
||||
invalid.append(f"{obj_path}<key: {key}>")
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user