Skip to content

Commit

Permalink
replace yaml.load calls with yaml.safe_load
Browse files Browse the repository at this point in the history
since the use yaml.load function without a Loader argument is deprecated since
pyyaml 5.1 replace yaml.loader calls with yaml.safe_loader.
yaml.safe_loader is a shorthand for calling yaml.load with the SafeLoader class
as Loader argument.
  • Loading branch information
Arvid Krein committed Nov 14, 2022
1 parent 88f031f commit 9356f6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/run_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def parse_yaml(filename, key):
"""

with open(filename, "r") as infile:
ret = yaml.load(infile)
ret = yaml.safe_load(infile)

return ret[key]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# YAML imports
try:
import yaml # PyYAML
loader = yaml.load
loader = yaml.safe_load
except ImportError:
try:
import ruamel_yaml as yaml # Ruamel YAML
Expand Down

0 comments on commit 9356f6b

Please sign in to comment.