Skip to content

Commit

Permalink
#4393 failure to redirect should not propagate
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Oct 29, 2024
1 parent 6559e64 commit 0011ee0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xpra/os_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,13 @@ def __enter__(self):
devnull = os.open(os.devnull, os.O_WRONLY)
os.dup2(devnull, 2)
os.close(devnull)
sys.stderr = os.fdopen(self.savedstderr, 'w')
try:
sys.stderr = os.fdopen(self.savedstderr, 'w')
except OSError as e:
try:
sys.stderr.write(f"failed to replace stderr: {e}\n")
except:
pass

def __exit__(self, *_args):
if self.savedstderr is not None:
Expand Down

0 comments on commit 0011ee0

Please sign in to comment.