uasyncio: wait: Add workaround against heap alloc on empty iteration.

"for a in ():" unconditionally allocates heap so far, per
https://github.com/micropython/micropython/issues/2716 . So, test for
empty result before iterating over it.
pull/62/merge
Paul Sokolovsky 2016-12-28 10:25:31 +03:00
rodzic 9d5919dd1c
commit f29be360c0
1 zmienionych plików z 11 dodań i 8 usunięć

Wyświetl plik

@ -60,6 +60,9 @@ class EpollEventLoop(EventLoop):
else:
res = self.poller.poll(delay, 1)
#log.debug("epoll result: %s", res)
# Remove "if res" workaround after
# https://github.com/micropython/micropython/issues/2716 fixed.
if res:
for fd, ev in res:
cb = self.objmap[fd]
if __debug__: