Skip to content

Commit b54987b

Browse files
reidwagnerpfalcon
authored andcommitted
select: Convert float timeout to int with math.ceil.
In CPython, timeout is a float and the value rounded up to the nearest millisecond.
1 parent 03c1e65 commit b54987b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

select/select.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import errno
55
import ffilib
66
import utime
7+
import math
78
from uselect import *
89

910

@@ -92,7 +93,7 @@ def poll_ms(self, timeout=-1):
9293
return res
9394

9495
def poll(self, timeout=-1):
95-
return self.poll_ms(-1 if timeout == -1 else timeout * 1000)
96+
return self.poll_ms(-1 if timeout == -1 else math.ceil(timeout * 1000))
9697

9798
def close(self):
9899
os.close(self.epfd)

0 commit comments

Comments
 (0)