Load the YAML data safely

It would disallow for arbitary objects from being created and makes the
file-loading safe.
This commit is contained in:
Pradyun S. Gedam 2016-05-29 18:08:44 +05:30
parent 1104edcf6d
commit b3a6fcc9a9
1 changed files with 1 additions and 1 deletions

2
ddt.py
View File

@ -184,7 +184,7 @@ def process_file_data(cls, name, func, file_attr):
with open(data_file_path) as f:
# Load the data from YAML or JSON
if _is_yaml_file:
data = yaml.load(f)
data = yaml.safe_load(f)
else:
data = json.load(f)