Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mkosi/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1906,9 +1906,9 @@ def from_json(cls, s: Union[str, dict[str, Any], SupportsRead[str], SupportsRead
j: dict[str, Any]
if isinstance(s, str):
j = json.loads(s)
elif isinstance(s, dict):
elif isinstance(s, dict) and not hasattr(s, "read"):
j = s
elif hasattr(s, "read"):
elif hasattr(s, "read") and not isinstance(s, dict):
j = json.load(s)
else:
raise ValueError(
Expand Down Expand Up @@ -2482,9 +2482,9 @@ def from_partial_json(
j: dict[str, Any]
if isinstance(s, str):
j = json.loads(s)
elif isinstance(s, dict):
elif isinstance(s, dict) and not hasattr(s, "read"):
j = s
elif hasattr(s, "read"):
elif hasattr(s, "read") and not isinstance(s, dict):
j = json.load(s)
else:
raise ValueError(
Expand Down
Loading