mirror of https://github.com/python/cpython
Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError.
This commit is contained in:
parent
467a5c4067
commit
b5588c3f94
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue