mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-18 09:11:31 +08:00
Fix: FileNotFoundError when './submodule' not exists
This commit is contained in:
@@ -8,13 +8,14 @@ def list_mod():
|
|||||||
global MOD_LIST
|
global MOD_LIST
|
||||||
if not MOD_LIST:
|
if not MOD_LIST:
|
||||||
MOD_LIST = []
|
MOD_LIST = []
|
||||||
for dir_name in os.listdir('./submodule'):
|
if os.path.exists('./submodule'):
|
||||||
mod_path = os.path.join('./submodule', dir_name)
|
for dir_name in os.listdir('./submodule'):
|
||||||
if os.path.isdir(mod_path):
|
mod_path = os.path.join('./submodule', dir_name)
|
||||||
for file_name in os.listdir(mod_path):
|
if os.path.isdir(mod_path):
|
||||||
mod_name, ext = os.path.splitext(file_name)
|
for file_name in os.listdir(mod_path):
|
||||||
if ext == '.py':
|
mod_name, ext = os.path.splitext(file_name)
|
||||||
MOD_LIST.append((mod_name, dir_name))
|
if ext == '.py':
|
||||||
|
MOD_LIST.append((mod_name, dir_name))
|
||||||
|
|
||||||
return MOD_LIST
|
return MOD_LIST
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user