From b5588c3f94b351c7c57fd7d26a305200b5a6c45f Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Mon, 9 Apr 2012 01:41:34 +0200 Subject: [PATCH] Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError. --- Lib/SocketServer.py | 4 ++-- Lib/test/test_socketserver.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/SocketServer.py b/Lib/SocketServer.py index a44e1378547..1594321909c 100644 --- a/Lib/SocketServer.py +++ b/Lib/SocketServer.py @@ -153,8 +153,8 @@ def _eintr_retry(func, *args): while True: try: return func(*args) - except OSError as e: - if e.errno != errno.EINTR: + except (OSError, select.error) as e: + if e.args[0] != errno.EINTR: raise class BaseServer: diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py index 3c7287a0812..3b333bc7f5c 100644 --- a/Lib/test/test_socketserver.py +++ b/Lib/test/test_socketserver.py @@ -243,7 +243,7 @@ class SocketServerTest(unittest.TestCase): self.called += 1 if self.called == 1: # raise the exception on first call - raise OSError(errno.EINTR, os.strerror(errno.EINTR)) + raise select.error(errno.EINTR, os.strerror(errno.EINTR)) else: # Return real select value for consecutive calls return old_select(*args)