Skip to content

Commit

Permalink
Use safe YAML loader
Browse files Browse the repository at this point in the history
yaml.load() is unsafe and issues a warning. Switching to the safe loader
explicitly.
  • Loading branch information
imphil authored and olofk committed May 8, 2019
1 parent 3faaeae commit 0a07c95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_verilator.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_verilator_configure():
work_root = tempfile.mkdtemp()
edam_file = os.path.join(ref_dir, mode, core_name) + '.eda.yml'

backend = get_edatool(tool)(edam=yaml.load(open(edam_file)), work_root=work_root)
backend = get_edatool(tool)(edam=yaml.safe_load(open(edam_file)), work_root=work_root)

if mode is 'cc':
_params = params
Expand All @@ -48,7 +48,7 @@ def test_verilator_run():

work_root = tempfile.mkdtemp()
edam_file = os.path.join(ref_dir_cc, core_name)+ '.eda.yml'
backend = get_edatool(tool)(edam=yaml.load(open(edam_file)), work_root=work_root)
backend = get_edatool(tool)(edam=yaml.safe_load(open(edam_file)), work_root=work_root)
dummy_exe = 'V'+backend.tool_options['top_module']
shutil.copy(os.path.join(ref_dir, dummy_exe),
os.path.join(work_root, dummy_exe))
Expand Down

0 comments on commit 0a07c95

Please sign in to comment.