mirror of
https://github.com/beetbox/beets.git
synced 2026-12-01 12:26:08 -06:00
Merge pull request #3225 from sbraz/safe_load
Replace more instances of unsafe calls to yaml.load
This commit is contained in:
+1
-1
@@ -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(
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user