Fix: [ALAS] Catch OSError when iter running emulators

(cherry picked from commit dc530e75386d4575a36bc52a76bf41c2aecd8898)
This commit is contained in:
LmeSzinc 2024-08-30 18:50:53 +08:00
parent c91ec3cf2b
commit 224a59b054

View File

@ -506,9 +506,10 @@ class EmulatorManager(EmulatorManagerBase):
try: try:
exe = proc.cmdline() exe = proc.cmdline()
exe = exe[0].replace(r'\\', '/').replace('\\', '/') exe = exe[0].replace(r'\\', '/').replace('\\', '/')
except (psutil.AccessDenied, psutil.NoSuchProcess, IndexError): except (psutil.AccessDenied, psutil.NoSuchProcess, IndexError, OSError):
# psutil.AccessDenied # psutil.AccessDenied
# NoSuchProcess: process no longer exists (pid=xxx) # NoSuchProcess: process no longer exists (pid=xxx)
# OSError: [WinError 87] 参数错误。: '(originated from ReadProcessMemory)'
continue continue
if Emulator.is_emulator(exe): if Emulator.is_emulator(exe):