mirror of
https://github.com/python/cpython.git
synced 2024-11-24 10:24:35 +08:00
This commit is contained in:
parent
3f2155ffe6
commit
1b038e0738
@ -815,7 +815,14 @@ class SysLogHandler(logging.Handler):
|
||||
|
||||
if isinstance(address, str):
|
||||
self.unixsocket = True
|
||||
self._connect_unixsocket(address)
|
||||
# Syslog server may be unavailable during handler initialisation.
|
||||
# C's openlog() function also ignores connection errors.
|
||||
# Moreover, we ignore these errors while logging, so it not worse
|
||||
# to ignore it also here.
|
||||
try:
|
||||
self._connect_unixsocket(address)
|
||||
except OSError:
|
||||
pass
|
||||
else:
|
||||
self.unixsocket = False
|
||||
if socktype is None:
|
||||
|
Loading…
Reference in New Issue
Block a user