Index: asyncore.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/asyncore.py,v retrieving revision 1.60 diff -C2 -r1.60 asyncore.py *** asyncore.py 13 Aug 2004 20:06:57 -0000 1.60 --- asyncore.py 27 Aug 2004 19:16:11 -0000 *************** *** 108,116 **** r = []; w = []; e = [] for fd, obj in map.items(): ! e.append(fd) ! if obj.readable(): r.append(fd) ! if obj.writable(): w.append(fd) if [] == r == w == e: time.sleep(timeout) --- 108,119 ---- r = []; w = []; e = [] for fd, obj in map.items(): ! is_r = obj.readable() ! is_w = obj.writable() ! if is_r: r.append(fd) ! if is_w: w.append(fd) + if is_r or is_w: + e.append(fd) if [] == r == w == e: time.sleep(timeout) *************** *** 152,156 **** if map: for fd, obj in map.items(): ! flags = select.POLLERR | select.POLLHUP | select.POLLNVAL if obj.readable(): flags |= select.POLLIN | select.POLLPRI --- 155,159 ---- if map: for fd, obj in map.items(): ! flags = 0 if obj.readable(): flags |= select.POLLIN | select.POLLPRI *************** *** 158,161 **** --- 161,169 ---- flags |= select.POLLOUT if flags: + # Only check for exceptions if object was either readable + # or writable. + flags |= select.POLLERR | select.POLLHUP | select.POLLNVAL + + if flags: pollster.register(fd, flags) try: