Skip to content

Commit dcef3a9

Browse files
blink1073meeseeksmachine
authored andcommitted
Backport PR #669: Keep preferring SelectorEventLoop on Windows
1 parent ac29e22 commit dcef3a9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

ipykernel/kernelapp.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -516,14 +516,21 @@ def _init_asyncio_patch(self):
516516
Pick the older SelectorEventLoopPolicy on Windows
517517
if the known-incompatible default policy is in use.
518518
519+
Support for Proactor via a background thread is available in tornado 6.1,
520+
but it is still preferable to run the Selector in the main thread
521+
instead of the background.
522+
519523
do this as early as possible to make it a low priority and overrideable
520524
521525
ref: https://github.com/tornadoweb/tornado/issues/2608
522526
523-
FIXME: if/when tornado supports the defaults in asyncio,
524-
remove and bump tornado requirement for py38
527+
FIXME: if/when tornado supports the defaults in asyncio without threads,
528+
remove and bump tornado requirement for py38.
529+
Most likely, this will mean a new Python version
530+
where asyncio.ProactorEventLoop supports add_reader and friends.
531+
525532
"""
526-
if sys.platform.startswith("win") and sys.version_info >= (3, 8) and tornado.version_info < (6, 1):
533+
if sys.platform.startswith("win") and sys.version_info >= (3, 8):
527534
import asyncio
528535
try:
529536
from asyncio import (

0 commit comments

Comments
 (0)