Skip to content

Commit

Permalink
yaml: use safe_load(f) instead of load(f, Loader=yaml.FullLoader)
Browse files Browse the repository at this point in the history
yaml.FullLoader is not always defined
  • Loading branch information
bkueng committed Jul 11, 2019
1 parent 27ef189 commit 3743e6d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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, Loader=yaml.FullLoader)
return yaml.safe_load(f)
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, Loader=yaml.FullLoader)
return yaml.safe_load(f)
except OSError as e:
if e.errno == errno.ENOENT:
raise IOError(errno.ENOENT, os.strerror(errno.ENOENT), file)
Expand Down

0 comments on commit 3743e6d

Please sign in to comment.