Skip to content

Commit 3c741b4

Browse files
committed
win/tests: Use IOCP asyncio loop on Windows
1 parent e671939 commit 3c741b4

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
@@ -230,7 +230,11 @@ def tearDown(self):
230230
super().tearDown()
231231

232232
def new_loop(self):
233-
return asyncio.new_event_loop()
233+
if hasattr(asyncio, 'ProactorEventLoop'):
234+
# On Windows try to use IOCP event loop.
235+
return asyncio.ProactorEventLoop()
236+
else:
237+
return asyncio.new_event_loop()
234238

235239

236240
###############################################################################

0 commit comments

Comments
 (0)