diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-09 07:22:01 (GMT) |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2012-10-09 07:22:01 (GMT) |
commit | 7903df4125186c050f7b04990cd367d9fa485603 (patch) | |
tree | 3501116b32f854ab8bc2c72fb80cdbc0c603c76b /Lib/logging | |
parent | ad01498fa9c3cade5fad7586710e1491de31f47e (diff) | |
parent | b5ca932be26a1762b9db78b29f2946fd9ae3c2d4 (diff) | |
download | cpython-7903df4125186c050f7b04990cd367d9fa485603.zip cpython-7903df4125186c050f7b04990cd367d9fa485603.tar.gz cpython-7903df4125186c050f7b04990cd367d9fa485603.tar.bz2 |
Issue #16168: Merged SysLogHandler update from 3.2.
Diffstat (limited to 'Lib/logging')
-rw-r--r-- | Lib/logging/handlers.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py index 1bad856..2918360 100644 --- a/Lib/logging/handlers.py +++ b/Lib/logging/handlers.py @@ -794,18 +794,12 @@ class SysLogHandler(logging.Handler): self.formatter = None def _connect_unixsocket(self, address): - self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM) - # syslog may require either DGRAM or STREAM sockets + self.socket = socket.socket(socket.AF_UNIX, self.socktype) try: self.socket.connect(address) except socket.error: self.socket.close() - self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - try: - self.socket.connect(address) - except socket.error: - self.socket.close() - raise + raise def encodePriority(self, facility, priority): """ |