uasyncio: Ignore ENOENT on remove_writer().

StreamWriter.awrite() first tries to write to an fd, and if that succeeds,
yield IOWrite may never be called for that fd, and it will never be added
to poller. So, ignore such error.
pull/11/head
Paul Sokolovsky 2014-10-27 00:30:28 +02:00
rodzic 0fcb1daa81
commit e8b99addbd
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -28,7 +28,15 @@ class EpollEventLoop(EventLoop):
def remove_writer(self, fd):
if __debug__:
log.debug("remove_writer(%s)", fd)
try:
self.poller.unregister(fd)
except OSError as e:
# StreamWriter.awrite() first tries to write to an fd,
# and if that succeeds, yield IOWrite may never be called
# for that fd, and it will never be added to poller. So,
# ignore such error.
if e.args[0] != errno.ENOENT:
raise
def wait(self, delay):
if __debug__: