mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-10-04 09:35:16 -07:00
fix(server): route writelines through the pipe-safe write
writelines() was forwarded straight to the wrapped stream by __getattr__, so it could still raise BrokenPipeError after the app's pipe closed.
This commit is contained in:
committed by
capy-ai-staging[bot]
parent
848bb2e4c6
commit
c9f5f2c3e7
@@ -47,6 +47,10 @@ class _PipeSafeStream:
|
||||
self._stream = open(os.devnull, 'w')
|
||||
return len(s)
|
||||
|
||||
def writelines(self, lines):
|
||||
for line in lines:
|
||||
self.write(line)
|
||||
|
||||
def flush(self):
|
||||
try:
|
||||
self._stream.flush()
|
||||
|
||||
Reference in New Issue
Block a user