diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-04-28 11:04:58 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2011-04-28 11:04:58 (GMT) |
commit | 7fe1d51924b2863fb2d47eab73ee09932c02f50f (patch) | |
tree | 99e9ebd980438cbfcdcb278041ff120e7e984b22 /Lib/logging | |
parent | e812bf7bf6b7c1826b5e2c2488176a93cc6968bc (diff) | |
download | cpython-7fe1d51924b2863fb2d47eab73ee09932c02f50f.zip cpython-7fe1d51924b2863fb2d47eab73ee09932c02f50f.tar.gz cpython-7fe1d51924b2863fb2d47eab73ee09932c02f50f.tar.bz2 |
Improved test_logging coverage.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/__init__.py | 2 | ||||
-rw-r--r-- | Lib/logging/handlers.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index cd640bb..7f7d5c9 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -296,7 +296,7 @@ class LogRecord(object): # for an example try: self.processName = mp.current_process().name - except StandardError: + except StandardError: #pragma: no cover pass if logProcesses and hasattr(os, 'getpid'): self.process = os.getpid() diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 322b969..1923d93 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -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 |