[Python-checkins] cpython (3.2): 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:12 CEST 2012
http://hg.python.org/cpython/rev/f8e7fcd581ff
changeset: 76171:f8e7fcd581ff
branch: 3.2
parent: 76169:4f5b44de5c37
user: Antoine Pitrou <solipsis at pitrou.net>
date: Mon Apr 09 01:37:19 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
@@ -244,7 +244,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