From: Vinay Sajip Date: Tue, 10 May 2011 06:48:28 +0000 (+0100) Subject: Issue #12039: Now suppress spurious select.error raised on FreeBSD when the server... X-Git-Tag: v3.3.0a1~2324^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e73afad50fa7c892fd267922223e345ff80e6dd8;p=python Issue #12039: Now suppress spurious select.error raised on FreeBSD when the server (an asyncore.dispatcher) is closed. --- 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): """