mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-12 16:47:03 +08:00
Add: fake module PIL for webui (#4374)
* Add: fake module PIL for webui * Fix: Load runtime before module PIL * Upd: Error message of MAA loading failure * Upd: Adjust timing of import fake module
This commit is contained in:
@@ -50,11 +50,6 @@ class Asst:
|
||||
platform_type = platform.system().lower()
|
||||
if platform_type == 'windows':
|
||||
lib_import_func = ctypes.WinDLL
|
||||
try:
|
||||
# Override by System32 dll
|
||||
lib_import_func(os.path.join(os.environ['SystemRoot'], 'System32/msvcp140.dll'))
|
||||
except Exception as e:
|
||||
pass
|
||||
else:
|
||||
lib_import_func = ctypes.CDLL
|
||||
|
||||
|
||||
@@ -31,7 +31,12 @@ class AssistantHandler:
|
||||
AssistantHandler.Asst = asst.Asst
|
||||
AssistantHandler.Message = utils.Message
|
||||
AssistantHandler.InstanceOptionType = utils.InstanceOptionType
|
||||
AssistantHandler.Asst.load(path, user_dir=path, incremental_path=incremental_path)
|
||||
try:
|
||||
AssistantHandler.Asst.load(path, user_dir=path, incremental_path=incremental_path)
|
||||
except OSError as e:
|
||||
logger.critical(e)
|
||||
logger.critical("MAA加载失败,请检查MAA本体能否正常打开")
|
||||
raise RequestHumanTakeover
|
||||
|
||||
AssistantHandler.ASST_HANDLER = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user