Switch to yaml.safe_load to squash warnings

This commit is contained in:
Phil Howard 2019-10-09 22:17:44 +01:00
parent 38e8adcec3
commit 40b64471c9
2 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ def load(file):
_data = json.loads(_data)
elif _type == '---':
_data = re.search('\n(.*)\n', _data.group(0), re.DOTALL).group(0)
_data = yaml.load(_data)
_data = yaml.safe_load(_data)
else:
data = {}

View File

@ -117,17 +117,17 @@ def load(lang='en'):
pinout_path = os.path.join(BASE_DIR,'src/{}/template/{}'.format(lang, PINOUT_FILE))
if SETTINGS_FILE.endswith('.yaml'):
settings = yaml.load(open(settings_path).read())
settings = yaml.safe_load(open(settings_path).read())
else:
settings = json.load(open(settings_path))
if STRINGS_FILE.endswith('.yaml'):
strings = yaml.load(open(strings_path).read())
strings = yaml.safe_load(open(strings_path).read())
else:
strings = json.load(open(strings_path))
if PINOUT_FILE.endswith('.yaml'):
pinout = yaml.load(open(pinout_path).read())
pinout = yaml.safe_load(open(pinout_path).read())
else:
pinout = json.load(open(pinout_path))