Skip to content

Commit 2c66eb4

Browse files
committed
Load YAML safely
1 parent 8a33a8f commit 2c66eb4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

scripts/import.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def process(element_name: str, *, year: str, handle_dep: Callable[[str], int]) -
4242
data = data.replace('$YYYY', str(year))
4343
data = data.replace('$SRYYYY', f'SR{year}')
4444

45-
raw_elements = yaml.load(data)
45+
raw_elements = yaml.safe_load(data)
4646
if 'summary' not in raw_elements and 'description' not in raw_elements:
4747
raise RuntimeError(f"{path} contains neither a summary nor a description")
4848

scripts/validate-reachability.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def strip_dot_yaml(text: str) -> str:
2727
linked.add(element)
2828
try:
2929
with Path(element).with_suffix('.yaml').open() as f:
30-
data = yaml.load(f)
30+
data = yaml.safe_load(f)
3131
for dependency in data.get('dependencies', ()):
3232
if dependency not in linked:
3333
worklist.add(dependency)

0 commit comments

Comments
 (0)