Skip to content

Commit

Permalink
Merge e556a20 into 7d3a241
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Apr 16, 2020
2 parents 7d3a241 + e556a20 commit cb518ff
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changes/1570.bugfix
@@ -0,0 +1,2 @@
Make monkey-patching properly remove ``select.epoll`` and
``select.kqueue``. Reported by Kirill Smelkov.
2 changes: 1 addition & 1 deletion src/gevent/select.py
Expand Up @@ -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',
Expand Down
32 changes: 32 additions & 0 deletions src/gevent/tests/test__monkey_select.py
@@ -0,0 +1,32 @@
# 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()

0 comments on commit cb518ff

Please sign in to comment.