Skip to content

Commit c6eff3d

Browse files
authored
Use asyncio.WindowsSelectorEventLoopPolicy for 3.8+
https://twistedmatrix.com/trac/ticket/9766
1 parent 33a1d1a commit c6eff3d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pytest_twisted.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,12 @@ def init_qt5_reactor():
272272

273273

274274
def init_asyncio_reactor():
275+
if sys.version_info >= (3, 8):
276+
# If twisted releases a fix/workaround we can check that version too
277+
# https://twistedmatrix.com/trac/ticket/9766
278+
selector_policy = asyncio.WindowsSelectorEventLoopPolicy()
279+
asyncio.set_event_loop_policy(selector_policy)
280+
275281
from twisted.internet import asyncioreactor
276282

277283
_install_reactor(

0 commit comments

Comments
 (0)