Files
deb-python-eventlet/tests/isolated/patcher_blocking_select_methods_are_deleted.py
Jakub Stasiak ebdcce00d9 green selectors: Remove non-green selectors
The code pretending that all the selector classes exist and
"implementing" them using SelectSelector was added in [1] because there
was no facility to easily remove things from green version of modules
(as far as I understand) - the facility has been added in [2] thus
allowing us to make this change.

As mentioned in the code I believe this approach is likely to be less
confusing than the previous one (SelectSelector doesn't expose fileno()
method that the other selectors have so it's not fully API-compatible
with them).

[1] 0d509ef7d2
[2] f63165c0e3
2016-01-11 22:14:57 +01:00

28 lines
765 B
Python

if __name__ == '__main__':
import eventlet
eventlet.monkey_patch()
# Leaving unpatched select methods in the select module is a recipe
# for trouble and this test makes sure we don't do that.
#
# Issues:
# * https://bitbucket.org/eventlet/eventlet/issues/167
# * https://github.com/eventlet/eventlet/issues/169
import select
for name in ['poll', 'epoll', 'kqueue', 'kevent']:
assert not hasattr(select, name), name
import sys
if sys.version_info >= (3, 4):
import selectors
for name in [
'PollSelector',
'EpollSelector',
'DevpollSelector',
'KqueueSelector',
]:
assert not hasattr(selectors, name), name
print('pass')