test: Wettlauf beim Lesen von /proc/<pid>/stat abfangen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Florian Wilde
2026-10-10 23:43:40 +02:00
co-authored by Claude Opus 5.5
parent ce5bef8306
commit d46b1ba5c5
+1 -1
View File
@@ -127,7 +127,7 @@ def _alive(pid: int) -> bool:
try: try:
with open(f"/proc/{pid}/stat") as fh: with open(f"/proc/{pid}/stat") as fh:
return fh.read().split(")")[-1].split()[0] != "Z" return fh.read().split(")")[-1].split()[0] != "Z"
except FileNotFoundError: except (FileNotFoundError, ProcessLookupError): # verschwindet beim Lesen → ESRCH
return False return False