mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-25 10:01:10 +00:00
Fix: [ALAS] Handle psutil.NoSuchProcess
This commit is contained in:
parent
f02d6ad3af
commit
0a1c0e3dbd
@ -121,7 +121,10 @@ class DataProcessInfo:
|
||||
|
||||
@cached_property
|
||||
def name(self):
|
||||
try:
|
||||
name = self.proc.name()
|
||||
except:
|
||||
name = ''
|
||||
return name
|
||||
|
||||
@cached_property
|
||||
@ -130,6 +133,7 @@ class DataProcessInfo:
|
||||
cmdline = self.proc.cmdline()
|
||||
except:
|
||||
# psutil.AccessDenied
|
||||
# # NoSuchProcess: process no longer exists (pid=xxx)
|
||||
cmdline = []
|
||||
cmdline = ' '.join(cmdline).replace(r'\\', '/').replace('\\', '/')
|
||||
return cmdline
|
||||
|
@ -471,8 +471,9 @@ class EmulatorManager(EmulatorManagerBase):
|
||||
try:
|
||||
exe = proc.cmdline()
|
||||
exe = exe[0].replace(r'\\', '/').replace('\\', '/')
|
||||
except (psutil.AccessDenied, IndexError):
|
||||
except (psutil.AccessDenied, psutil.NoSuchProcess, IndexError):
|
||||
# psutil.AccessDenied
|
||||
# NoSuchProcess: process no longer exists (pid=xxx)
|
||||
continue
|
||||
|
||||
if Emulator.is_emulator(exe):
|
||||
|
Loading…
Reference in New Issue
Block a user