Fix yaml parsing
This commit is contained in:
@@ -334,9 +334,6 @@ class CustomSettings(object):
|
|||||||
|
|
||||||
|
|
||||||
def load_yaml(path):
|
def load_yaml(path):
|
||||||
try:
|
|
||||||
return yaml.load(path, Loader=yaml.SafeLoader)
|
|
||||||
except yaml.YAMLError as exc:
|
|
||||||
if os.path.exists(Path(path)):
|
if os.path.exists(Path(path)):
|
||||||
with open(path, "r", encoding="utf-8") as f:
|
with open(path, "r", encoding="utf-8") as f:
|
||||||
return yaml.load(f, Loader=yaml.SafeLoader)
|
return yaml.load(f, Loader=yaml.SafeLoader)
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ import yaml
|
|||||||
|
|
||||||
|
|
||||||
def get_weights(path):
|
def get_weights(path):
|
||||||
try:
|
|
||||||
return yaml.load(path, Loader=yaml.SafeLoader)
|
|
||||||
except yaml.YAMLError as exc:
|
|
||||||
if os.path.exists(Path(path)):
|
if os.path.exists(Path(path)):
|
||||||
with open(path, "r", encoding="utf-8") as f:
|
with open(path, "r", encoding="utf-8") as f:
|
||||||
return yaml.load(f, Loader=yaml.SafeLoader)
|
return yaml.load(f, Loader=yaml.SafeLoader)
|
||||||
|
|||||||
Reference in New Issue
Block a user