summaryrefslogtreecommitdiff
path: root/Lib/test/test_logging.py
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-05-10 07:48:28 +0100
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-05-10 07:48:28 +0100
commite73afad50fa7c892fd267922223e345ff80e6dd8 (patch)
treef884c9f4d2d345f2190e0cebfcc701ea0e6dab0f /Lib/test/test_logging.py
parent00bc6ccb786aa2976cc6c405738247359539854c (diff)
downloadcpython-git-e73afad50fa7c892fd267922223e345ff80e6dd8.tar.gz
Issue #12039: Now suppress spurious select.error raised on FreeBSD when the server (an asyncore.dispatcher) is closed.
Diffstat (limited to 'Lib/test/test_logging.py')
-rw-r--r--Lib/test/test_logging.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py
index 07bb46a0a7..1768e8b36d 100644
--- a/Lib/test/test_logging.py
+++ b/Lib/test/test_logging.py
@@ -723,7 +723,14 @@ class TestSMTPServer(smtpd.SMTPServer):
:func:`select` or :func:`poll` call by
:func:`asyncore.loop`.
"""
- asyncore.loop(poll_interval, map=self.sockmap)
+ try:
+ asyncore.loop(poll_interval, map=self.sockmap)
+ except select.error:
+ # On FreeBSD 8, closing the server repeatably
+ # raises this error. We swallow it if the
+ # server has been closed.
+ if self.connected or self.accepting:
+ raise
def stop(self, timeout=None):
"""