made aip.select() compatible with non-twistedr hubs

This commit is contained in:
Denis Bilenko
2008-10-27 22:48:30 +06:00
parent 98204fe7b6
commit 00e2f04921

View File

@@ -186,17 +186,17 @@ def select(read_list, write_list, error_list, timeout=None):
def on_read(d):
cleanup(t)
original = ds[d.fileno()]['read']
original = ds[get_fileno(d)]['read']
greenlib.switch(current, ([original], [], []))
def on_write(d):
cleanup(t)
original = ds[d.fileno()]['write']
original = ds[get_fileno(d)]['write']
greenlib.switch(current, ([], [original], []))
def on_error(d, _err):
def on_error(d, _err=None):
cleanup(t)
original = ds[d.fileno()]['error']
original = ds[get_fileno(d)]['error']
greenlib.switch(current, ([], [], [original]))
def on_timeout():