fix: correct PermissionError handling in is_process_alive, add corrupt PID test

This commit is contained in:
2026-05-21 12:15:19 +08:00
parent 6416f8a8e2
commit 8a2e4b6cc0
2 changed files with 11 additions and 3 deletions

View File

@@ -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: