Skip to content

Commit

Permalink
win/tests: Use IOCP asyncio loop on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
1st1 committed Nov 24, 2016
1 parent e671939 commit 3c741b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion uvloop/_testbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


###############################################################################
Expand Down

0 comments on commit 3c741b4

Please sign in to comment.