summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-04-27 13:18:06 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-04-27 13:18:06 (GMT)
commitdbeb27461c2de891ae6cfe42c803e4ca7a111c15 (patch)
tree3e0c2b88b212a6be86248666df3f5e89efc0e170 /Lib/test/test_logging.py
parent5a35b06d5e5b6d12abcc1529cbb643fdcf0d35ab (diff)
downloadcpython-dbeb27461c2de891ae6cfe42c803e4ca7a111c15.zip
cpython-dbeb27461c2de891ae6cfe42c803e4ca7a111c15.tar.gz
cpython-dbeb27461c2de891ae6cfe42c803e4ca7a111c15.tar.bz2
test_logging: handle syslogd connection failure.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py11
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()