diff options
author | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
---|---|---|
committer | Andrew Svetlov <andrew.svetlov@gmail.com> | 2012-12-18 21:10:48 (GMT) |
commit | 0832af6628ca5ac02d0226899725297dd508470b (patch) | |
tree | fc4e7d05d9c6f51eb97f3e8abbcab2b226330b94 /Lib/logging/handlers.py | |
parent | ad28c7f9dad791567afa0624acfb3ba430851965 (diff) | |
download | cpython-0832af6628ca5ac02d0226899725297dd508470b.zip cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.gz cpython-0832af6628ca5ac02d0226899725297dd508470b.tar.bz2 |
Issue #16717: get rid of socket.error, replace with OSError
Diffstat (limited to 'Lib/logging/handlers.py')
-rw-r--r-- | Lib/logging/handlers.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 4cbc320..1491b47 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -514,7 +514,7 @@ class SocketHandler(logging.Handler): try: self.sock = self.makeSocket() self.retryTime = None # next time, no delay before trying - except socket.error: + except OSError: #Creation failed, so set the retry time and return. if self.retryTime is None: self.retryPeriod = self.retryStart @@ -539,7 +539,7 @@ class SocketHandler(logging.Handler): if self.sock: try: self.sock.sendall(s) - except socket.error: #pragma: no cover + except OSError: #pragma: no cover self.sock.close() self.sock = None # so we can call createSocket next time @@ -775,7 +775,7 @@ class SysLogHandler(logging.Handler): self.socket = socket.socket(socket.AF_UNIX, self.socktype) try: self.socket.connect(address) - except socket.error: + except OSError: self.socket.close() raise @@ -842,7 +842,7 @@ class SysLogHandler(logging.Handler): if self.unixsocket: try: self.socket.send(msg) - except socket.error: + except OSError: self._connect_unixsocket(self.address) self.socket.send(msg) elif self.socktype == socket.SOCK_DGRAM: |