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 @@ -631,6 +631,11 @@ def _register_send_sockets(self):
631631 self ._selector .register (conn ._sock , selectors .EVENT_WRITE , conn )
632632
633633 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
634639 # This needs to be locked, but since it is only called from within the
635640 # locked section of poll(), there is no additional lock acquisition here
636641 processed = set ()
@@ -639,8 +644,6 @@ def _poll(self, timeout):
639644 self ._register_send_sockets ()
640645
641646 start_select = time .time ()
642- if timeout == float ('inf' ):
643- timeout = None
644647 ready = self ._selector .select (timeout )
645648 end_select = time .time ()
646649 if self ._sensors :
You can’t perform that action at this time.
0 commit comments