mirror of https://github.com/python/cpython
Closes #16168: Merged SysLogHandler update from 3.3.
This commit is contained in:
commit
6978d58e18
|
@ -790,18 +790,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):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue