Created originally on Bitbucket by jstasiak (Jakub Stasiak)
Changesets for this Pull Request have not been imported, because it had been already declined on Bitbucket. Marked as closed by the import user.
CPython raises OSError rather than IOError when kqueue.control
fails (see https://github.com/python/cpython/blob/622179787a056abc8fae40fe47083949bc3b0063/Modules/selectmodule.c#L2112)
My apologies for the fact that I may or may not include unrelated commits from default branch in this pull request (Bitbucket suggests I will), please ignore them, there's one commit of mine that matters here.