remove obsolete hasattr() check for socket.sendall

This commit is contained in:
Giampaolo Rodola' 2012-10-26 18:32:24 +02:00
parent 9a56f8c1ed
commit f9de90a935
1 changed files with 1 additions and 9 deletions

View File

@ -538,15 +538,7 @@ class SocketHandler(logging.Handler):
#but are still unable to connect.
if self.sock:
try:
if hasattr(self.sock, "sendall"):
self.sock.sendall(s)
else: #pragma: no cover
sentsofar = 0
left = len(s)
while left > 0:
sent = self.sock.send(s[sentsofar:])
sentsofar = sentsofar + sent
left = left - sent
except socket.error: #pragma: no cover
self.sock.close()
self.sock = None # so we can call createSocket next time