diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-06-25 22:20:27 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-06-25 22:20:27 (GMT) |
commit | a57a8e072c8a6f6c5b71abaf245892977ee372dc (patch) | |
tree | 00103f4081e8fe306cc31c99e19200cdcb7976bf /Lib/logging | |
parent | 0b1b9ce494ee91ed525a83b802e15cd9a03922d5 (diff) | |
parent | 3e6d71d3360f2b8dd0232b492d0a63cc6b5419d3 (diff) | |
download | cpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.zip cpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.tar.gz cpython-a57a8e072c8a6f6c5b71abaf245892977ee372dc.tar.bz2 |
Closes #15179: Merged fix from 3.2.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 7a97c80..1bad856 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -801,7 +801,11 @@ class SysLogHandler(logging.Handler): except socket.error: self.socket.close() self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - self.socket.connect(address) + try: + self.socket.connect(address) + except socket.error: + self.socket.close() + raise def encodePriority(self, facility, priority): """ |