Commit fb4b3f40 authored by Jason Madden's avatar Jason Madden Committed by GitHub

Merge pull request #1571 from gevent/issue1570

Make monkey-patching properly remove select.epoll and select.kqueue.
parents 7d3a2417 e556a20a
Make monkey-patching properly remove ``select.epoll`` and
``select.kqueue``. Reported by Kirill Smelkov.
......@@ -329,7 +329,7 @@ def _gevent_do_monkey_patch(patch_request):
# modules (e.g. asyncore) non-blocking, as they use select that we provide
# when none of these are available.
patch_request.remove_item(
'epoll'
'epoll',
'kqueue',
'kevent',
'devpoll',
......
# Tests for the monkey-patched select module.
from gevent import monkey
monkey.patch_all()
import select
import gevent.testing as greentest
class TestSelect(greentest.TestCase):
def _make_test(name, ns): # pylint:disable=no-self-argument
def test(self):
self.assertIs(getattr(select, name, self), self)
self.assertFalse(hasattr(select, name))
test.__name__ = 'test_' + name + '_removed'
ns[test.__name__] = test
for name in (
'epoll',
'kqueue',
'kevent',
'devpoll',
):
_make_test(name, locals())
del name
del _make_test
if __name__ == '__main__':
greentest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment