Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7903df4

Browse files
committed
Issue #16168: Merged SysLogHandler update from 3.2.
2 parents ad01498 + b5ca932 commit 7903df4

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

Lib/logging/handlers.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -794,18 +794,12 @@ def __init__(self, address=('localhost', SYSLOG_UDP_PORT),
794794
self.formatter = None
795795

796796
def _connect_unixsocket(self, address):
797-
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM)
798-
# syslog may require either DGRAM or STREAM sockets
797+
self.socket = socket.socket(socket.AF_UNIX, self.socktype)
799798
try:
800799
self.socket.connect(address)
801800
except socket.error:
802801
self.socket.close()
803-
self.socket = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
804-
try:
805-
self.socket.connect(address)
806-
except socket.error:
807-
self.socket.close()
808-
raise
802+
raise
809803

810804
def encodePriority(self, facility, priority):
811805
"""

0 commit comments

Comments
 (0)