green selectors: Override DefaultSelector as well

The original patch[1] missed one thing which I just discovered - there's
selectors.DefaultSelector alias for the "the most efficient implementation
available on the current platform"[2].

Before this patch a non-green selector class would be obtained when
DefaultSelector was used.

[1] 0d509ef7d2
[2] https://docs.python.org/3.5/library/selectors.html#selectors.DefaultSelector
This commit is contained in:
Jakub Stasiak
2016-01-11 22:25:15 +01:00
parent 2506a37fa3
commit 16aa6cb370
2 changed files with 6 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ from eventlet import patcher
from eventlet.green import select
__patched__ = [
'DefaultSelector',
'SelectSelector',
]
@@ -29,3 +30,5 @@ del patcher
if sys.platform != 'win32':
SelectSelector._select = staticmethod(select.select)
DefaultSelector = SelectSelector

View File

@@ -24,4 +24,7 @@ if __name__ == '__main__':
]:
assert not hasattr(selectors, name), name
default = selectors.DefaultSelector
assert default is selectors.SelectSelector, default
print('pass')