Skip to content

Commit ced0a00

Browse files
committed
edit
1 parent 879ce72 commit ced0a00

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fancontroller.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
def main():
88
# 从配置文件中读取数据
99
with open('fan_settings.json', 'r') as file:
10-
data = json.load(file)
10+
try:
11+
data = json.load(file)
12+
except json.JSONDecodeError:
13+
input("错误:文件内容不是有效的JSON格式,请检查配置后重新打开,输入任意键退出程序:")
1114

1215
servers = data['servers']
1316
windows_ipmi_tool_path = data['windows_ipmi_tool_path']

0 commit comments

Comments
 (0)