From 7ff55530fc7fc47223dbe0098f1f555a4dff0ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 11 Jul 2019 08:18:12 +0200 Subject: [PATCH] yaml: use safe_load(f) instead of load(f, Loader=yaml.FullLoader) yaml.FullLoader is not always defined --- msg/tools/uorb_rtps_classifier.py | 2 +- msg/tools/uorb_to_ros_rtps_ids.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/msg/tools/uorb_rtps_classifier.py b/msg/tools/uorb_rtps_classifier.py index 6480243c886f..e1d8b57418bb 100644 --- a/msg/tools/uorb_rtps_classifier.py +++ b/msg/tools/uorb_rtps_classifier.py @@ -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( diff --git a/msg/tools/uorb_to_ros_rtps_ids.py b/msg/tools/uorb_to_ros_rtps_ids.py index ff5b2a0c642a..b739da79e5dd 100644 --- a/msg/tools/uorb_to_ros_rtps_ids.py +++ b/msg/tools/uorb_to_ros_rtps_ids.py @@ -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)