select: Convert float timeout to int with math.ceil.

In CPython, timeout is a float and the value rounded up to the
nearest millisecond.
pull/222/merge
Reid Wagner 2017-10-23 09:14:18 -07:00 zatwierdzone przez Paul Sokolovsky
rodzic 03c1e65e6e
commit b54987bd14
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -4,6 +4,7 @@ import os
import errno
import ffilib
import utime
import math
from uselect import *
@ -92,7 +93,7 @@ class Epoll:
return res
def poll(self, timeout=-1):
return self.poll_ms(-1 if timeout == -1 else timeout * 1000)
return self.poll_ms(-1 if timeout == -1 else math.ceil(timeout * 1000))
def close(self):
os.close(self.epfd)