From f9de90a935c0294b32e2c5dc00efb28884a0e3c7 Mon Sep 17 00:00:00 2001 From: Giampaolo Rodola' Date: Fri, 26 Oct 2012 18:32:24 +0200 Subject: [PATCH] remove obsolete hasattr() check for socket.sendall --- Lib/logging/handlers.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 6b73b7a6cc0..4cbc320d354 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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 + self.sock.sendall(s) except socket.error: #pragma: no cover self.sock.close() self.sock = None # so we can call createSocket next time