Commit b5bd095e authored by berumuron's avatar berumuron
Browse files

tec: Use `yaml.safe_load`

`yaml.load` is deprecated.
parent a358609d
...@@ -14,7 +14,7 @@ def load(configuration_path, environment, output_path): ...@@ -14,7 +14,7 @@ def load(configuration_path, environment, output_path):
if os.path.exists(configuration_path): if os.path.exists(configuration_path):
with open(configuration_path) as conf_file: with open(configuration_path) as conf_file:
conf_data = yaml.load(conf_file) conf_data = yaml.safe_load(conf_file)
for key, value in conf_data.items(): for key, value in conf_data.items():
if key == "development": if key == "development":
continue continue
......
...@@ -50,7 +50,7 @@ YAML_FRONT_MATTER_REGEX = re.compile("(---\n.*\n)(---\n)(.*)", re.M | re.S) ...@@ -50,7 +50,7 @@ YAML_FRONT_MATTER_REGEX = re.compile("(---\n.*\n)(---\n)(.*)", re.M | re.S)
def extract_yaml_configuration(content): def extract_yaml_configuration(content):
match = YAML_FRONT_MATTER_REGEX.match(content) match = YAML_FRONT_MATTER_REGEX.match(content)
if match: if match:
yaml_conf = yaml.load(match.group(1)) yaml_conf = yaml.safe_load(match.group(1))
return yaml_conf, match.group(3) return yaml_conf, match.group(3)
else: else:
return {}, content return {}, content
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment