From 84e22e4a8cdec677f157d1142560b40b0af31990 Mon Sep 17 00:00:00 2001 From: Aldo Adirajasa Fathoni Date: Tue, 26 Sep 2023 13:23:20 +0700 Subject: [PATCH] Ignore if pty process has exited --- console/socketiod | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/console/socketiod b/console/socketiod index 3c3c9b6..55342d1 100755 --- a/console/socketiod +++ b/console/socketiod @@ -200,8 +200,13 @@ def disconnect(sid): global child_pid # kill pty process - os.kill(child_pid, signal.SIGKILL) - os.wait() + try: + os.kill(child_pid, signal.SIGKILL) + os.wait() + except ProcessLookupError: + pass + except ChildProcessError: + pass # reset the variables fd = None