From 99458139a531270b4948fe3c8c4fb3627d4ad6bc Mon Sep 17 00:00:00 2001 From: Tully Foote Date: Thu, 2 May 2019 13:31:50 -0700 Subject: [PATCH] Switch to yaml.safe_load (#21069) Re: https://msg.pyyaml.org/load --- scripts/check_rosdep.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/check_rosdep.py b/scripts/check_rosdep.py index 633d370060d13..dab0099a97b09 100755 --- a/scripts/check_rosdep.py +++ b/scripts/check_rosdep.py @@ -135,7 +135,7 @@ def fun(i, l, o): prev = st[lvl] try: # parse as yaml to parse `"foo bar"` as string 'foo bar' not string '"foo bar"' - item = yaml.load(m.groups()[0]) + item = yaml.safe_load(m.groups()[0]) except: print('woops line %d' % i) raise @@ -160,7 +160,7 @@ def my_assert(val): # here be tests. ydict = None try: - ydict = yaml.load(buf) + ydict = yaml.safe_load(buf) except Exception: pass if ydict != {}: @@ -176,7 +176,7 @@ def my_assert(val): else: print_test("skipping file with empty dict contents...") try: - ydict = yaml.load(buf) + ydict = yaml.safe_load(buf) # ensure that values don't contain whitespaces whitespace_whitelist = ["el capitan", "mountain lion"]