Skip to content

Commit e89af2f

Browse files
committed
fix(script-load): will not use deprecated method yaml.load(...)
1 parent 35c2b35 commit e89af2f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hooks/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ def _parse_and_apply_scripts(script: str, server: PluginServerInterface):
173173

174174
try:
175175
# 读取
176+
_yml = yaml.YAML()
176177
with open(cfg.temp_config.scripts_list.get(script), 'r') as f:
177-
content: dict[str, Union[str, Union[list, dict]]] = yaml.load(f.read(), Loader=yaml.Loader)
178+
content: dict[str, Union[str, Union[list, dict]]] = _yml.load(f) # yaml.load(f.read(), Loader=yaml.Loader)
178179

179180
if content is not None:
180181
if content.get('tasks') is not None:

0 commit comments

Comments
 (0)