Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion entity/config_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def load_design_from_mapping(data: Mapping[str, Any], *, source: str | None = No
def load_design_from_file(path: Path) -> DesignConfig:
"""Read a YAML file and parse it into a :class:`DesignConfig`."""
with path.open("r", encoding="utf-8") as handle:
data = yaml.load(handle, Loader=yaml.FullLoader)
data = yaml.safe_load(handle)
if not isinstance(data, Mapping):
raise ConfigError("YAML root must be a mapping", path=str(path))
return load_design_from_mapping(data, source=str(path))
2 changes: 1 addition & 1 deletion utils/io_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

def read_yaml(path) -> Dict[str, Any]:
with open(path, mode="r", encoding="utf-8") as f:
return yaml.load(f, Loader=yaml.FullLoader)
return yaml.safe_load(f)