From 3c741b4c27fec94569ff8c65222e4f314cf44079 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Wed, 23 Nov 2016 19:34:08 -0500 Subject: [PATCH] win/tests: Use IOCP asyncio loop on Windows --- uvloop/_testbase.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/uvloop/_testbase.py b/uvloop/_testbase.py index 44c7fd6d..e5256456 100644 --- a/uvloop/_testbase.py +++ b/uvloop/_testbase.py @@ -230,7 +230,11 @@ def tearDown(self): super().tearDown() def new_loop(self): - return asyncio.new_event_loop() + if hasattr(asyncio, 'ProactorEventLoop'): + # On Windows try to use IOCP event loop. + return asyncio.ProactorEventLoop() + else: + return asyncio.new_event_loop() ###############################################################################