[Python-checkins] r70904 - python/trunk/Lib/asyncore.py

josiah.carlson python-checkins at python.org
Tue Mar 31 23:49:36 CEST 2009


Author: josiah.carlson
Date: Tue Mar 31 23:49:36 2009
New Revision: 70904

Log:
Made handle_expt_event() be called last, so that we don't accidentally read
after closing the socket.


Modified:
   python/trunk/Lib/asyncore.py

Modified: python/trunk/Lib/asyncore.py
==============================================================================
--- python/trunk/Lib/asyncore.py	(original)
+++ python/trunk/Lib/asyncore.py	Tue Mar 31 23:49:36 2009
@@ -97,14 +97,14 @@
 
 def readwrite(obj, flags):
     try:
-        if flags & select.POLLPRI:
-            obj.handle_expt_event()
         if flags & select.POLLIN:
             obj.handle_read_event()
         if flags & select.POLLOUT:
             obj.handle_write_event()
         if flags & (select.POLLHUP | select.POLLERR | select.POLLNVAL):
             obj.handle_close()
+        if flags & select.POLLPRI:
+            obj.handle_expt_event()
     except _reraised_exceptions:
         raise
     except:


More information about the Python-checkins mailing list