From 86d5abfa45c0dd0af8fac1f4dca950d5fa9f5e88 Mon Sep 17 00:00:00 2001 From: Malfurious Date: Fri, 17 Feb 2023 17:17:01 -0500 Subject: comm: Squelch BrokenPipeError during shutdown() Failure to close target stdout is not interesting. Furthermore, if sploit ever gets into this situation, the user script has likely already raised a more useful error/backtrace. Handling this exception typically results in a duplicate error. Signed-off-by: Malfurious Signed-off-by: dusoleil --- sploit/comm.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sploit/comm.py b/sploit/comm.py index 67c97bc..50ef3dc 100644 --- a/sploit/comm.py +++ b/sploit/comm.py @@ -18,7 +18,10 @@ class Comm: self.back = backend def shutdown(self): - self.back.stdout.close() + try: + self.back.stdout.close() + except BrokenPipeError: + pass def read(self, size): data = os.read(self.back.stdin.fileno(), size) -- cgit v1.2.3