mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Improved test_logging coverage.
This commit is contained in:
parent
e812bf7bf6
commit
7fe1d51924
3 changed files with 65 additions and 7 deletions
|
|
@ -490,14 +490,14 @@ class SocketHandler(logging.Handler):
|
|||
try:
|
||||
if hasattr(self.sock, "sendall"):
|
||||
self.sock.sendall(s)
|
||||
else:
|
||||
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:
|
||||
except socket.error: #pragma: no cover
|
||||
self.sock.close()
|
||||
self.sock = None # so we can call createSocket next time
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue