summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorJosiah Carlson <josiah.carlson@gmail.com>2009-03-31 21:49:36 (GMT)
committerJosiah Carlson <josiah.carlson@gmail.com>2009-03-31 21:49:36 (GMT)
commitaba27dd6d9bcd6de8f028505d837915b6a1828b7 (patch)
treef2017415fe69baaa1d25d4eb2e5ec01052aa0a1b /Lib
parentbcd64a3fc727e773d4efac3995faa44cc973bb3d (diff)
downloadcpython-aba27dd6d9bcd6de8f028505d837915b6a1828b7.zip
cpython-aba27dd6d9bcd6de8f028505d837915b6a1828b7.tar.gz
cpython-aba27dd6d9bcd6de8f028505d837915b6a1828b7.tar.bz2
Made handle_expt_event() be called last, so that we don't accidentally read
after closing the socket.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/asyncore.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/asyncore.py b/Lib/asyncore.py
index f9b0fdf..07b0499 100644
--- a/Lib/asyncore.py
+++ b/Lib/asyncore.py
@@ -97,14 +97,14 @@ def _exception(obj):
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: