bpo-33792: Add selector and proactor windows policies (GH-7487)
(cherry picked from commit 8f4042964d5b0ddf5cdf87862db962ba64e3f64a)
Co-authored-by: Yury Selivanov <yury@magic.io>
diff --git a/Lib/asyncio/windows_events.py b/Lib/asyncio/windows_events.py
index d22edec..2ec5427 100644
--- a/Lib/asyncio/windows_events.py
+++ b/Lib/asyncio/windows_events.py
@@ -21,7 +21,8 @@
__all__ = (
'SelectorEventLoop', 'ProactorEventLoop', 'IocpProactor',
- 'DefaultEventLoopPolicy',
+ 'DefaultEventLoopPolicy', 'WindowsSelectorEventLoopPolicy',
+ 'WindowsProactorEventLoopPolicy',
)
@@ -801,8 +802,12 @@
SelectorEventLoop = _WindowsSelectorEventLoop
-class _WindowsDefaultEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
+class WindowsSelectorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
_loop_factory = SelectorEventLoop
-DefaultEventLoopPolicy = _WindowsDefaultEventLoopPolicy
+class WindowsProactorEventLoopPolicy(events.BaseDefaultEventLoopPolicy):
+ _loop_factory = ProactorEventLoop
+
+
+DefaultEventLoopPolicy = WindowsSelectorEventLoopPolicy