Skip to content

Commit

Permalink
YAML: use Loaders and safe_load (#11910)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexisTM authored and bkueng committed Jul 10, 2019
1 parent 6da8ce9 commit 453ecfe
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Tools/validate_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
def load_yaml_file(file_name):
with open(file_name, 'r') as stream:
try:
return yaml.load(stream)
return yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
raise
Expand Down
2 changes: 1 addition & 1 deletion msg/tools/uorb_rtps_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def parse_yaml_msg_id_file(yaml_file):
"""
try:
with open(yaml_file, 'r') as f:
return yaml.load(f)
return yaml.load(f, Loader=yaml.FullLoader)
except OSError as e:
if e.errno == errno.ENOENT:
raise IOError(errno.ENOENT, os.strerror(
Expand Down
2 changes: 1 addition & 1 deletion msg/tools/uorb_to_ros_rtps_ids.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def load_yaml_file(file):
with open(file, 'r') as f:
if verbose:
print("--\t[Step 1] %s yaml file loaded!" % file)
return yaml.load(f)
return yaml.load(f, Loader=yaml.FullLoader)
except OSError as e:
if e.errno == errno.ENOENT:
raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), file)
Expand Down

0 comments on commit 453ecfe

Please sign in to comment.