File tree Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Expand file tree Collapse file tree 1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change 24
24
25
25
def process_exe (process : psutil .Process ) -> str :
26
26
"""
27
- psutil.Process(pid).exe() returns "" for zombie processes, incorrectly. It should raise ZombieProcess, and return ""
28
- only for kernel threads.
29
-
30
- See https://github.com/giampaolo/psutil/pull/2062
27
+ psutil.Process(pid).exe() caches the result. This function returns the up-to-date exe in case the process exec-ed.
31
28
"""
32
- # Clear the "exe" cache on the process object. It can change after being cached if the process execed.
29
+ # Clear the "exe" cache on the process object
33
30
process ._exe = None # type: ignore
34
31
exe = process .exe ()
35
32
if exe == "" :
36
- if is_process_zombie (process ):
37
- raise psutil .ZombieProcess (process .pid )
38
33
raise MissingExePath (process )
39
34
return exe
40
35
You can’t perform that action at this time.
0 commit comments