Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0aa9ee

Browse files
committed
Fix the patch for issue #7978: select() raises select.error before 3.3, not OSError.
1 parent f18d6f3 commit c0aa9ee

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/socketserver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ def _eintr_retry(func, *args):
153153
while True:
154154
try:
155155
return func(*args)
156-
except OSError as e:
157-
if e.errno != errno.EINTR:
156+
except (OSError, select.error) as e:
157+
if e.args[0] != errno.EINTR:
158158
raise
159159

160160
class BaseServer:

Lib/test/test_socketserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def __call__(self, *args):
244244
self.called += 1
245245
if self.called == 1:
246246
# raise the exception on first call
247-
raise OSError(errno.EINTR, os.strerror(errno.EINTR))
247+
raise select.error(errno.EINTR, os.strerror(errno.EINTR))
248248
else:
249249
# Return real select value for consecutive calls
250250
return old_select(*args)

0 commit comments

Comments
 (0)