try/except Control socket writes

This commit is contained in:
jesopo 2019-10-11 15:16:39 +01:00
parent de389b34b8
commit 22b6a19054

View file

@ -13,7 +13,10 @@ class ControlClient(object):
return self._socket.fileno()
def read_lines(self) -> typing.List[str]:
data = self._socket.recv(2048)
try:
data = self._socket.recv(2048)
except:
data = b""
if not data:
return None
lines = (self._read_buffer+data).split(b"\n")