daun REALLY won't kill itself if not found process

This commit is contained in:
BarsTiger
2022-04-30 11:45:23 +03:00
parent b0badba791
commit 690553160f

View File

@@ -37,5 +37,6 @@ def kill(process_name: str = None, pid: int = None) -> None:
Stop a process by name or PID
"""
if process_name:
pid = get_pid(process_name) if pid != psutil.Process().pid else None
pid = get_pid(process_name)
if pid != psutil.Process().pid:
psutil.Process(pid).kill()