Commit c0aa9eeb authored by Antoine Pitrou's avatar Antoine Pitrou

Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError.

parent f18d6f3f
...@@ -153,8 +153,8 @@ def _eintr_retry(func, *args): ...@@ -153,8 +153,8 @@ def _eintr_retry(func, *args):
while True: while True:
try: try:
return func(*args) return func(*args)
except OSError as e: except (OSError, select.error) as e:
if e.errno != errno.EINTR: if e.args[0] != errno.EINTR:
raise raise
class BaseServer: class BaseServer:
......
...@@ -244,7 +244,7 @@ class SocketServerTest(unittest.TestCase): ...@@ -244,7 +244,7 @@ class SocketServerTest(unittest.TestCase):
self.called += 1 self.called += 1
if self.called == 1: if self.called == 1:
# raise the exception on first call # raise the exception on first call
raise OSError(errno.EINTR, os.strerror(errno.EINTR)) raise select.error(errno.EINTR, os.strerror(errno.EINTR))
else: else:
# Return real select value for consecutive calls # Return real select value for consecutive calls
return old_select(*args) return old_select(*args)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment