mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Fix an old bug in poll(). When a signal is handled while we're
blocked in select(), this will raise select.error with errno set to EINTR. The except clauses correctly ignores this error, but the rest of the logic will then call read() for all objects in select's *input* list of read file descriptors. Then when an object's read_handler() is naive, it will call recv() on its socket, which will raise an IOError, and then asyncore decides to close the socket. To fix this, we simply return in this case. Backport candidate.
This commit is contained in:
parent
18142c0ca7
commit
e94d8fab56
1 changed files with 2 additions and 0 deletions
|
@ -109,6 +109,8 @@ def poll(timeout=0.0, map=None):
|
|||
except select.error, err:
|
||||
if err[0] != EINTR:
|
||||
raise
|
||||
else:
|
||||
return
|
||||
|
||||
for fd in r:
|
||||
obj = map.get(fd)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue