kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
0fcb1daa81
commit
e8b99addbd
|
@ -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__:
|
||||
|
|
Ładowanie…
Reference in New Issue