Skip to content

Commit 5bc48b3

Browse files
committed
win/tests: Use IOCP asyncio loop on Windows
1 parent 6d8636c commit 5bc48b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

uvloop/_testbase.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,11 @@ def tearDown(self):
306306
super().tearDown()
307307

308308
def new_loop(self):
309-
return asyncio.new_event_loop()
309+
if hasattr(asyncio, 'ProactorEventLoop'):
310+
# On Windows try to use IOCP event loop.
311+
return asyncio.ProactorEventLoop()
312+
else:
313+
return asyncio.new_event_loop()
310314

311315

312316
def has_IPv6():

0 commit comments

Comments
 (0)