* Migrated to PyYAML 5.1

* More intelligent fixing of yaml safe_load

Based on https://circleci.com/gh/home-assistant/home-assistant/34831?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link
This commit is contained in:
BackSlasher 2019-06-15 01:30:47 +03:00 committed by Paulus Schoutsen
parent 970b00b8d6
commit 50d282ff37
6 changed files with 6 additions and 6 deletions

View file

@ -60,7 +60,7 @@ def load_codes(path):
codes = []
if os.path.exists(path):
with open(path) as code_file:
data = yaml.load(code_file) or []
data = yaml.safe_load(code_file) or []
for code in data:
try:
codes.append(CODE_SCHEMA(code))

View file

@ -17,7 +17,7 @@ netdisco==2.6.0
pip>=8.0.3
python-slugify==3.0.2
pytz>=2019.01
pyyaml>=3.13,<4
pyyaml==5.1
requests==2.22.0
ruamel.yaml==0.15.97
sqlalchemy==1.3.3

View file

@ -12,7 +12,7 @@ cryptography==2.6.1
pip>=8.0.3
python-slugify==3.0.2
pytz>=2019.01
pyyaml>=3.13,<4
pyyaml==5.1
requests==2.22.0
ruamel.yaml==0.15.97
voluptuous==0.11.5

View file

@ -46,7 +46,7 @@ REQUIRES = [
'pip>=8.0.3',
'python-slugify==3.0.2',
'pytz>=2019.01',
'pyyaml>=3.13,<4',
'pyyaml==5.1',
'requests==2.22.0',
'ruamel.yaml==0.15.97',
'voluptuous==0.11.5',

View file

@ -400,7 +400,7 @@ def test_write_device():
device = apns.ApnsDevice('123', 'name', 'track_id', True)
apns._write_device(out, device)
data = yaml.load(out.getvalue())
data = yaml.safe_load(out.getvalue())
assert data == {
123: {
'name': 'name',

View file

@ -90,7 +90,7 @@ class TestScene(unittest.TestCase):
self.light_1.entity_id, self.light_2.entity_id)
with io.StringIO(config) as file:
doc = yaml_loader.yaml.load(file)
doc = yaml_loader.yaml.safe_load(file)
assert setup_component(self.hass, scene.DOMAIN, doc)
common.activate(self.hass, 'scene.test')