Skip to content

Commit

Permalink
[docs] Use yaml.safe_load() in build_*.py scripts (#2432)
Browse files Browse the repository at this point in the history
Co-authored-by: itchyny <[email protected]>
  • Loading branch information
nmulcahey and itchyny authored Jun 5, 2023
1 parent b7511b9 commit d178ebd
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/build_manpage.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def __write_raw(self, dat):

def load_yml_file(fn):
with open(fn) as f:
return yaml.load(f, Loader=yaml.Loader)
return yaml.safe_load(f)

def dedent_body(body):
lines = [re.sub(r'^ (\S)', r'\1', l) for l in body.split('\n')]
Expand Down
2 changes: 1 addition & 1 deletion docs/build_mantests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import yaml

with open("content/manual/manual.yml") as f:
manual = yaml.load(f)
manual = yaml.safe_load(f)
for section in manual.get('sections', []):
for entry in section.get('entries', []):
for example in entry.get('examples', []):
Expand Down
2 changes: 1 addition & 1 deletion docs/build_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def load_yml_file(fn):
with open(fn) as f:
return yaml.load(f, Loader=yaml.Loader)
return yaml.safe_load(f)

env.filters['search_id'] = lambda input: input.replace(r'`', '')
env.filters['section_id'] = lambda input: re.sub(r"[^a-zA-Z0-9_]", '', input)
Expand Down

0 comments on commit d178ebd

Please sign in to comment.