From a3bdb1c96cafe094b9179dd2fd4ccc3c6d18d121 Mon Sep 17 00:00:00 2001 From: mlhl <447181856@qq.com> Date: Tue, 7 May 2019 11:06:34 +0800 Subject: [PATCH] fix warning:YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe --- config/ticketConf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/ticketConf.py b/config/ticketConf.py index 8021737..14c272d 100755 --- a/config/ticketConf.py +++ b/config/ticketConf.py @@ -14,10 +14,10 @@ def _get_yaml(): path = os.path.join(os.path.dirname(__file__) + '/ticket_config.yaml') try: # 兼容2和3版本 with open(path, encoding="utf-8") as f: - s = yaml.load(f) + s = yaml.load(f, Loader=yaml.FullLoader) except Exception: with open(path) as f: - s = yaml.load(f) + s = yaml.load(f, Loader=yaml.FullLoader) return s.decode() if isinstance(s, bytes) else s