]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Backport 1.38:
authorRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 07:16:37 +0000 (07:16 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 21 Feb 2003 07:16:37 +0000 (07:16 +0000)
 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.

Backport 1.40:
 Fix spelling error

Lib/asyncore.py

index bae416b560636ce253431b200fc724bd14241a5c..d9d2fd84bc7423eaf8188a4732f8b31d7ebc8e32 100644 (file)
@@ -84,7 +84,8 @@ def poll (timeout=0.0, map=None):
             except select.error, err:
                 if err[0] != EINTR:
                     raise
-                r = []; w = []; e = []
+                else:
+                    return
 
         if DEBUG:
             print r,w,e
@@ -370,7 +371,7 @@ class dispatcher:
     def __getattr__ (self, attr):
         return getattr (self.socket, attr)
 
-    # log and log_info maybe overriden to provide more sophisitcated
+    # log and log_info maybe overriden to provide more sophisticated
     # logging and warning methods. In general, log is for 'hit' logging
     # and 'log_info' is for informational, warning and error logging.