summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2011-05-10 06:48:28 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2011-05-10 06:48:28 (GMT)
commite73afad50fa7c892fd267922223e345ff80e6dd8 (patch)
treef884c9f4d2d345f2190e0cebfcc701ea0e6dab0f
parent00bc6ccb786aa2976cc6c405738247359539854c (diff)
downloadcpython-e73afad50fa7c892fd267922223e345ff80e6dd8.zip
cpython-e73afad50fa7c892fd267922223e345ff80e6dd8.tar.gz
cpython-e73afad50fa7c892fd267922223e345ff80e6dd8.tar.bz2
Issue #12039: Now suppress spurious select.error raised on FreeBSD when the server (an asyncore.dispatcher) is closed.
-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 07bb46a..1768e8b 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):
"""