update 0.0.7.0

This commit is contained in:
HibiKier
2021-12-16 11:16:28 +08:00
parent b892617824
commit 2653f67193
141 changed files with 2693 additions and 547 deletions
+5 -1
View File
@@ -19,7 +19,11 @@ class StaticData:
if file.exists():
with open(file, "r", encoding="utf8") as f:
if file.name.endswith("json"):
self._data: dict = json.load(f)
try:
self._data: dict = json.load(f)
except ValueError:
if f.read().strip():
raise ValueError(f"{file} 文件加载错误,请检查文件内容格式.")
elif file.name.endswith("yaml"):
self._data = yaml.load(f)