[Python-checkins] cpython (2.7): Fix the patch for issue #7978: select() raises select.error before 3.3, not
antoine.pitrou
python-checkins at python.org
Mon Apr 9 01:47:13 CEST 2012
http://hg.python.org/cpython/rev/4298d6e79ecb
changeset: 76173:4298d6e79ecb
branch: 2.7
parent: 76168:463fd270c5de
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon Apr 09 01:41:34 2012 +0200
summary:
Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError.
files:
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
--- a/Lib/SocketServer.py
+++ b/Lib/SocketServer.py
@@ -153,8 +153,8 @@
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
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -243,7 +243,7 @@
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)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list