Handle disconnects on flush.

This commit is contained in:
Aldo Cortesi
2012-07-30 11:30:31 +12:00
parent 4fb5d15f14
commit eafa5566c2

View File

@@ -48,8 +48,11 @@ class FileLike:
return getattr(self.o, attr)
def flush(self):
if hasattr(self.o, "flush"):
self.o.flush()
try:
if hasattr(self.o, "flush"):
self.o.flush()
except socket.error, v:
raise NetLibDisconnect(str(v))
def read(self, length):
"""