From e310ffc4e2932080ef6c668ac68ba7ab51e8a190 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sat, 28 Sep 2019 23:53:15 -0500 Subject: [PATCH] try to fix stdout broken pipe --- onionr/onionrcommands/daemonlaunch.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/onionr/onionrcommands/daemonlaunch.py b/onionr/onionrcommands/daemonlaunch.py index f7dc500a..335f738d 100755 --- a/onionr/onionrcommands/daemonlaunch.py +++ b/onionr/onionrcommands/daemonlaunch.py @@ -114,8 +114,14 @@ def daemon(): except KeyboardInterrupt: pass cleanup.delete_run_files() - sys.stderr.close() - sys.stdout.close() + try: + sys.stderr.close() + except (IOError, BrokenPipeError) as e: + pass + try: + sys.stdout.close() + except (IOError, BrokenPipeError) as e: + pass def _ignore_sigint(sig, frame): '''This space intentionally left blank'''