fix: correct PermissionError handling in is_process_alive, add corrupt PID test
This commit is contained in:
@@ -47,8 +47,10 @@ def is_process_alive(pid: int) -> bool:
|
||||
try:
|
||||
os.kill(pid, 0)
|
||||
return True
|
||||
except (ProcessLookupError, PermissionError):
|
||||
except ProcessLookupError:
|
||||
return False
|
||||
except PermissionError:
|
||||
return True # process exists but owned by another user
|
||||
|
||||
|
||||
def check_stale(config_dir: Path, name: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user