Skip to content

Commit adb46b6

Browse files
authored
Update pytest_twisted.py
1 parent c6eff3d commit adb46b6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

pytest_twisted.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,11 +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)
275+
if sys.platform == 'win32':
276+
if sys.version_info >= (3, 8):
277+
# If twisted releases a fix/workaround we can check that version too
278+
# https://twistedmatrix.com/trac/ticket/9766
279+
selector_policy = asyncio.WindowsSelectorEventLoopPolicy()
280+
asyncio.set_event_loop_policy(selector_policy)
280281

281282
from twisted.internet import asyncioreactor
282283

0 commit comments

Comments
 (0)