]> granicus.if.org Git - python/commitdiff
Fix an old bug in poll(). When a signal is handled while we're
authorGuido van Rossum <guido@python.org>
Tue, 5 Nov 2002 18:41:20 +0000 (18:41 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 5 Nov 2002 18:41:20 +0000 (18:41 +0000)
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.

Lib/asyncore.py

index 33d414a9f374b5b6f4b21c48e97124ed8bb2ec1f..2c94813f25bae16da74d86339a81adba7475e9a8 100644 (file)
@@ -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)