Skip to content

Commit

Permalink
Merge pull request #771 from linuxmaniac/3.0
Browse files Browse the repository at this point in the history
replace SafeLineLoader to PythonSafeLoader
  • Loading branch information
dwainscheeren authored Feb 5, 2024
2 parents 6b33913 + 6d913a8 commit ab5c3f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions custom_components/dwains_dashboard/process_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ def load_yamll(fname, secrets = None, args={}):
"_global": llgen_config
}))
stream.name = fname
return loader.yaml.load(stream, Loader=lambda _stream: loader.SafeLineLoader(_stream, secrets)) or OrderedDict()
return loader.yaml.load(stream, Loader=lambda _stream: loader.PythonSafeLoader(_stream, secrets)) or OrderedDict()
else:
with open(fname, encoding="utf-8") as config_file:
return loader.yaml.load(config_file, Loader=lambda stream: loader.SafeLineLoader(stream, secrets)) or OrderedDict()
return loader.yaml.load(config_file, Loader=lambda stream: loader.PythonSafeLoader(stream, secrets)) or OrderedDict()
except loader.yaml.YAMLError as exc:
_LOGGER.error(str(exc))
raise HomeAssistantError(exc)
Expand All @@ -66,7 +66,7 @@ def _include_yaml(ldr, node):
raise HomeAssistantError(exc)

loader.load_yaml = load_yamll
loader.SafeLineLoader.add_constructor("!include", _include_yaml)
loader.PythonSafeLoader.add_constructor("!include", _include_yaml)

def compose_node(self, parent, index):
if self.check_event(yaml.events.AliasEvent):
Expand Down

0 comments on commit ab5c3f1

Please sign in to comment.