防止打包没有数据文件报错

This commit is contained in:
xaoyaoo 2023-12-28 19:55:21 +08:00
parent 742c781a14
commit bd9bc2bfb2

View File

@ -14,8 +14,12 @@ from .ui import app_show_chat, get_user_list, export
import os, json
VERSION_LIST_PATH = os.path.join(os.path.dirname(__file__), "version_list.json")
with open(VERSION_LIST_PATH, "r", encoding="utf-8") as f:
VERSION_LIST = json.load(f)
try:
VERSION_LIST_PATH = os.path.join(os.path.dirname(__file__), "version_list.json")
with open(VERSION_LIST_PATH, "r", encoding="utf-8") as f:
VERSION_LIST = json.load(f)
except:
VERSION_LIST = {}
VERSION_LIST_PATH = None
__version__ = "2.3.26"