diff options
-rw-r--r-- | Lib/test/test_logging.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 567d084..234d5ff 100644 --- a/Lib/test/test_logging.py +++ b/Lib/test/test_logging.py @@ -531,10 +531,13 @@ class HandlerTest(BaseTest): sockname = '/var/run/log' else: sockname = '/dev/log' - h = logging.handlers.SysLogHandler(sockname) - self.assertEqual(h.facility, h.LOG_USER) - self.assertTrue(h.unixsocket) - h.close() + try: + h = logging.handlers.SysLogHandler(sockname) + self.assertEqual(h.facility, h.LOG_USER) + self.assertTrue(h.unixsocket) + h.close() + except socket.error: # syslogd might not be available + pass h = logging.handlers.SMTPHandler('localhost', 'me', 'you', 'Log') self.assertEqual(h.toaddrs, ['you']) h.close() |