Author Alexey.Poryadin
Recipients Alexey.Poryadin
Date 2014-12-08.10:36:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418035005.39.0.294462650059.issue23009@psf.upfronthosting.co.za>
In-reply-to
Content
When is called `select`, but registered no one `fileobject` rise exception:
...
    polled = self._selector.select(timeout)
  File "/usr/lib/python3.4/selectors.py", line 424, in select
    fd_event_list = self._epoll.poll(timeout, max_ev)
ValueError: maxevents must be greater than 0, got 0

Of course, it makes no sense to call `select` if there is nothing to watch. But "select.epol.poll" is not raises exception in the same case if `max_ev`=-1. And this simplifies the application code and is useful if need just sleep for a timeout.

So, I suggest a small fix:
-    fd_event_list = self._epoll.poll(timeout, max_ev)
+    fd_event_list = self._epoll.poll(timeout, max_ev or -1)
History
Date User Action Args
2014-12-08 10:36:45Alexey.Poryadinsetrecipients: + Alexey.Poryadin
2014-12-08 10:36:45Alexey.Poryadinsetmessageid: <1418035005.39.0.294462650059.issue23009@psf.upfronthosting.co.za>
2014-12-08 10:36:45Alexey.Poryadinlinkissue23009 messages
2014-12-08 10:36:44Alexey.Poryadincreate