Jean-Paul Calderone <exar...@divmod.com> added the comment: > My first impression was that the '1' in 'kq.control(None, 4, 1)' already did this; i.e., that it meant that the kq.control function would wait up to 1 second for a response, but that doesn't seem to be true.
Since there are events in the result, the call succeeds immediately. The timeout only defines an upper bound on how long control will block before returning with *no* results. Since the loop doesn't handle any of the events, there's always some ready right away after the first call. > Out of curiosity, *why* is there a need to call this several times? It's out of the control of the test what the kernel does to deliver the event notifications. Since the test is waiting for multiple events, the loop helps it get them all (although clearly it's not totally reliable). ---------- nosy: +exarkun _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue5025> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com