File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -631,6 +631,11 @@ def _register_send_sockets(self):
631
631
self ._selector .register (conn ._sock , selectors .EVENT_WRITE , conn )
632
632
633
633
def _poll (self , timeout ):
634
+ # Python throws OverflowError if timeout is > 2147483647 milliseconds
635
+ # (though the param to selector.select is in seconds)
636
+ # so convert any too-large timeout to blocking
637
+ if timeout > 2147483 :
638
+ timeout = None
634
639
# This needs to be locked, but since it is only called from within the
635
640
# locked section of poll(), there is no additional lock acquisition here
636
641
processed = set ()
@@ -639,8 +644,6 @@ def _poll(self, timeout):
639
644
self ._register_send_sockets ()
640
645
641
646
start_select = time .time ()
642
- if timeout == float ('inf' ):
643
- timeout = None
644
647
ready = self ._selector .select (timeout )
645
648
end_select = time .time ()
646
649
if self ._sensors :
You can’t perform that action at this time.
0 commit comments