mirror of https://github.com/aristocratos/bpytop
Fixed exception when sending signal using uppercase T, K, I
parent
f00e840657
commit
36557dffee
|
@ -4495,9 +4495,9 @@ def process_keys():
|
||||||
elif key.lower() in ["t", "k", "i"] and (ProcBox.selected > 0 or ProcCollector.detailed):
|
elif key.lower() in ["t", "k", "i"] and (ProcBox.selected > 0 or ProcCollector.detailed):
|
||||||
pid: int = ProcBox.selected_pid if ProcBox.selected > 0 else ProcCollector.detailed_pid # type: ignore
|
pid: int = ProcBox.selected_pid if ProcBox.selected > 0 else ProcCollector.detailed_pid # type: ignore
|
||||||
if psutil.pid_exists(pid):
|
if psutil.pid_exists(pid):
|
||||||
if key == "t": sig = signal.SIGTERM
|
if key.lower() == "t": sig = signal.SIGTERM
|
||||||
elif key == "k": sig = signal.SIGKILL
|
elif key.lower() == "k": sig = signal.SIGKILL
|
||||||
elif key == "i": sig = signal.SIGINT
|
elif key.lower() == "i": sig = signal.SIGINT
|
||||||
try:
|
try:
|
||||||
os.kill(pid, sig)
|
os.kill(pid, sig)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
Loading…
Reference in New Issue