From e73afad50fa7c892fd267922223e345ff80e6dd8 Mon Sep 17 00:00:00 2001 From: Vinay Sajip Date: Tue, 10 May 2011 07:48:28 +0100 Subject: [PATCH] Issue #12039: Now suppress spurious select.error raised on FreeBSD when the server (an asyncore.dispatcher) is closed. --- Lib/test/test_logging.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_logging.py b/Lib/test/test_logging.py index 07bb46a0a70..1768e8b36db 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): """