mirror of
https://github.com/nasa/trick.git
synced 2024-12-20 05:37:55 +00:00
Replace deprecated yaml.load() with yaml.safe_load() (#1199)
Closes #1198 Co-authored-by: Dan Jordan <daniel.d.jordan@nasa.gov>
This commit is contained in:
parent
d16759fda5
commit
4b2dc2f8ec
@ -238,12 +238,12 @@ class TrickWorkflow(WorkflowCommon):
|
|||||||
Returns
|
Returns
|
||||||
-------
|
-------
|
||||||
dict or None
|
dict or None
|
||||||
dictionary representation of YAML content as parsed by yaml.load()
|
dictionary representation of YAML content as parsed by yaml.safe_load()
|
||||||
or None if parsing failed
|
or None if parsing failed
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
with open(config_file) as file:
|
with open(config_file) as file:
|
||||||
y = yaml.load(file)
|
y = yaml.safe_load(file)
|
||||||
return y
|
return y
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
tprint("Unable to parse config file: %s\nERROR: %s" % (config_file,e), 'DARK_RED')
|
tprint("Unable to parse config file: %s\nERROR: %s" % (config_file,e), 'DARK_RED')
|
||||||
|
Loading…
Reference in New Issue
Block a user