Replace more instances of unsafe calls to yaml.load

This commit is contained in:
Louis Sautier 2019-04-20 01:14:15 +02:00
parent 7b910c3fde
commit 4d98088cc1
No known key found for this signature in database
GPG key ID: A777716B30AE82E3
2 changed files with 2 additions and 2 deletions

View file

@ -74,7 +74,7 @@ def load(s):
"""
try:
out = []
for d in yaml.load_all(s):
for d in yaml.safe_load_all(s):
if not isinstance(d, dict):
raise ParseError(
u'each entry must be a dictionary; found {}'.format(

View file

@ -45,7 +45,7 @@ class ConfigCommandTest(unittest.TestCase, TestHelper):
def _run_with_yaml_output(self, *args):
output = self.run_with_output(*args)
return yaml.load(output)
return yaml.safe_load(output)
def test_show_user_config(self):
output = self._run_with_yaml_output('config', '-c')