asyncio_micro: Work around stupid Python closures.

Which don't close variables, just variable references.
pull/11/head
Paul Sokolovsky 2014-05-03 23:10:29 +03:00
rodzic 0b5ca354e2
commit 1c647189f1
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -69,10 +69,10 @@ class EventLoop:
elif isinstance(ret, IORead):
# self.add_reader(ret.obj.fileno(), lambda self, c, f: self.call_soon(c, f), self, cb, ret.obj)
# self.add_reader(ret.obj.fileno(), lambda c, f: self.call_soon(c, f), cb, ret.obj)
self.add_reader(ret.obj.fileno(), lambda f: self.call_soon(cb, f), ret.obj)
self.add_reader(ret.obj.fileno(), lambda cb, f: self.call_soon(cb, f), cb, ret.obj)
continue
elif isinstance(ret, IOWrite):
self.add_writer(ret.obj.fileno(), lambda f: self.call_soon(cb, f), ret.obj)
self.add_writer(ret.obj.fileno(), lambda cb, f: self.call_soon(cb, f), cb, ret.obj)
continue
elif isinstance(ret, IODone):
if ret.op == IO_READ: