Skip to content

Commit

Permalink
fix(script-load): will not use deprecated method yaml.load(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
OptiJava committed Feb 7, 2024
1 parent 35c2b35 commit e89af2f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ def _parse_and_apply_scripts(script: str, server: PluginServerInterface):

try:
# 读取
_yml = yaml.YAML()
with open(cfg.temp_config.scripts_list.get(script), 'r') as f:
content: dict[str, Union[str, Union[list, dict]]] = yaml.load(f.read(), Loader=yaml.Loader)
content: dict[str, Union[str, Union[list, dict]]] = _yml.load(f) # yaml.load(f.read(), Loader=yaml.Loader)

if content is not None:
if content.get('tasks') is not None:
Expand Down

0 comments on commit e89af2f

Please sign in to comment.