Adjust YAML loading for PyYAML 5.1
This commit is contained in:
parent
f9a98644ce
commit
9cd58b290d
|
|
@ -309,7 +309,7 @@ You can use:
|
|||
import yaml
|
||||
|
||||
with (config.configdir / 'config.yml').open() as f:
|
||||
yaml_data = yaml.load(f)
|
||||
yaml_data = yaml.safe_load(f)
|
||||
|
||||
for k, v in yaml_data.items():
|
||||
config.set(k, v)
|
||||
|
|
@ -339,7 +339,7 @@ You can use:
|
|||
import yaml
|
||||
|
||||
with (config.configdir / 'colors.yml').open() as f:
|
||||
yaml_data = yaml.load(f)
|
||||
yaml_data = yaml.safe_load(f)
|
||||
|
||||
def dict_attrs(obj, path=''):
|
||||
if isinstance(obj, dict):
|
||||
|
|
|
|||
|
|
@ -81,4 +81,4 @@ def register(linter):
|
|||
FAILED_LOAD = True
|
||||
return
|
||||
with yaml_file.open(mode='r', encoding='utf-8') as f:
|
||||
OPTIONS = list(yaml.load(f))
|
||||
OPTIONS = list(yaml.safe_load(f))
|
||||
|
|
|
|||
|
|
@ -167,7 +167,7 @@ class TestParseYamlType:
|
|||
|
||||
def _yaml(self, s):
|
||||
"""Get the type from parsed YAML data."""
|
||||
return yaml.load(textwrap.dedent(s))['type']
|
||||
return yaml.safe_load(textwrap.dedent(s))['type']
|
||||
|
||||
def test_simple(self):
|
||||
"""Test type which is only a name."""
|
||||
|
|
@ -254,7 +254,7 @@ class TestParseYamlBackend:
|
|||
|
||||
def _yaml(self, s):
|
||||
"""Get the type from parsed YAML data."""
|
||||
return yaml.load(textwrap.dedent(s))['backend']
|
||||
return yaml.safe_load(textwrap.dedent(s))['backend']
|
||||
|
||||
@pytest.mark.parametrize('backend, expected', [
|
||||
('QtWebKit', [usertypes.Backend.QtWebKit]),
|
||||
|
|
|
|||
Loading…
Reference in New Issue