Skip to content

Commit 4b48e14

Browse files
committed
Use yaml safe_load
1 parent c8b1db9 commit 4b48e14

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

dfetch_hub/project/project_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def from_yaml(cls, yaml_file: str) -> "ProjectParser":
4040
"""create parser from yaml file"""
4141
with open(yaml_file, "r", encoding="utf-8") as yamlf:
4242
instance = cls()
43-
yaml_data = yaml.load(yamlf.read(), Loader=yaml.Loader)
43+
yaml_data = yaml.safe_load(yamlf.read())
4444
for project in yaml_data["projects"]:
4545
parsed_project = RemoteProject.from_yaml(project)
4646
instance.add_project(parsed_project)

dfetch_hub/project/project_sources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def from_yaml(cls, yaml_data: Union[str, bytes]) -> "SourceList":
7676

7777
instance = cls()
7878

79-
parsed_yaml: Optional[Dict[str, Any]] = yaml.load(yaml_data, Loader=yaml.Loader)
79+
parsed_yaml: Optional[Dict[str, Any]] = yaml.safe_load(yaml_data)
8080
if not parsed_yaml:
8181
raise RuntimeError("file should have data")
8282
assert parsed_yaml["source-list"], "file should have list of sources"

0 commit comments

Comments
 (0)