forked from M-Labs/artiq
1
0
Fork 0

protocols/logging,pc_rpc: do not print errors on Windows when clients disconnect

This commit is contained in:
Sebastien Bourdeauducq 2016-01-27 21:23:22 +01:00
parent 7aaeb636e4
commit 27c12a5bf4
2 changed files with 6 additions and 0 deletions

View File

@ -125,6 +125,9 @@ class Server(AsyncioServer):
return
source, remainder = linesplit
parser.line_input(remainder)
except (ConnectionResetError, ConnectionAbortedError, BrokenPipeError):
# May happens on Windows when client disconnects
pass
finally:
writer.close()

View File

@ -502,6 +502,9 @@ class Server(_AsyncioServer):
"message": traceback.format_exc()}
line = pyon.encode(obj) + "\n"
writer.write(line.encode())
except (ConnectionResetError, ConnectionAbortedError, BrokenPipeError):
# May happens on Windows when client disconnects
pass
finally:
writer.close()