File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -672,6 +672,11 @@ def _register_send_sockets(self):
672
672
self ._selector .register (conn ._sock , selectors .EVENT_WRITE , conn )
673
673
674
674
def _poll (self , timeout ):
675
+ # Python throws OverflowError if timeout is > 2147483647 milliseconds
676
+ # (though the param to selector.select is in seconds)
677
+ # so convert any too-large timeout to blocking
678
+ if timeout > 2147483 :
679
+ timeout = None
675
680
# This needs to be locked, but since it is only called from within the
676
681
# locked section of poll(), there is no additional lock acquisition here
677
682
processed = set ()
@@ -680,8 +685,6 @@ def _poll(self, timeout):
680
685
self ._register_send_sockets ()
681
686
682
687
start_select = time .time ()
683
- if timeout == float ('inf' ):
684
- timeout = None
685
688
ready = self ._selector .select (timeout )
686
689
end_select = time .time ()
687
690
if self ._sensors :
You can’t perform that action at this time.
0 commit comments