mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 23:06:58 +08:00
safe yaml loader
This commit is contained in:
@@ -128,7 +128,7 @@ def parse_config(config):
|
||||
# Check whether config is file
|
||||
if os.path.exists(config):
|
||||
with open(config, "r") as f:
|
||||
return yaml.load(f)
|
||||
return yaml.load(f, Loader=yaml.SafeLoader)
|
||||
# Check whether the str can be parsed
|
||||
try:
|
||||
return yaml.load(config)
|
||||
|
||||
Reference in New Issue
Block a user