Don't use set() since it's not in python 2.3.

Just use a plain list instead.  Technically probably slightly worse
asymptotic behaviour, but it's not like we'll have a million sockets anyway.
This commit is contained in:
Avery Pennarun
2010-10-01 14:23:27 -07:00
parent da774f3f46
commit c403a83ab8
4 changed files with 34 additions and 21 deletions

View File

@ -158,9 +158,9 @@ def main():
if rpid:
raise Fatal('hostwatch exited unexpectedly: code 0x%04x\n' % rv)
r = set()
w = set()
x = set()
r = []
w = []
x = []
handlers = filter(lambda s: s.ok, handlers)
for s in handlers:
s.pre_select(r,w,x)
@ -169,10 +169,10 @@ def main():
mux.fullness, mux.too_full))
(r,w,x) = select.select(r,w,x)
#log('r=%r w=%r x=%r\n' % (r,w,x))
ready = set(r) | set(w) | set(x)
ready = r+w+x
for s in handlers:
#debug2('check: %r: %r\n' % (s, s.socks & ready))
if s.socks & ready:
if list_contains_any(s.socks, ready):
s.callback()
mux.check_fullness()
mux.callback()