Skip to content

Commit 480d6d6

Browse files
committed
try new tornado hotness
1 parent 0e8a00f commit 480d6d6

File tree

3 files changed

+27
-311
lines changed

3 files changed

+27
-311
lines changed

jupyter_server/pytest_plugin.py

Lines changed: 0 additions & 285 deletions
This file was deleted.

jupyter_server/serverapp.py

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,31 +1604,32 @@ def init_httpserver(self):
16041604

16051605
@staticmethod
16061606
def _init_asyncio_patch():
1607-
"""set default asyncio policy to be compatible with tornado
1608-
Tornado 6 (at least) is not compatible with the default
1609-
asyncio implementation on Windows
1610-
Pick the older SelectorEventLoopPolicy on Windows
1611-
if the known-incompatible default policy is in use.
1612-
do this as early as possible to make it a low priority and overrideable
1613-
ref: https://github.com/tornadoweb/tornado/issues/2608
1614-
FIXME: if/when tornado supports the defaults in asyncio,
1615-
remove and bump tornado requirement for py38
1616-
"""
1617-
if sys.platform.startswith("win") and sys.version_info >= (3, 8):
1618-
import asyncio
1619-
try:
1620-
from asyncio import (
1621-
WindowsProactorEventLoopPolicy,
1622-
WindowsSelectorEventLoopPolicy,
1623-
)
1624-
except ImportError:
1625-
pass
1626-
# not affected
1627-
else:
1628-
if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
1629-
# WindowsProactorEventLoopPolicy is not compatible with tornado 6
1630-
# fallback to the pre-3.8 default of Selector
1631-
asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())
1607+
return
1608+
# """set default asyncio policy to be compatible with tornado
1609+
# Tornado 6 (at least) is not compatible with the default
1610+
# asyncio implementation on Windows
1611+
# Pick the older SelectorEventLoopPolicy on Windows
1612+
# if the known-incompatible default policy is in use.
1613+
# do this as early as possible to make it a low priority and overrideable
1614+
# ref: https://github.com/tornadoweb/tornado/issues/2608
1615+
# FIXME: if/when tornado supports the defaults in asyncio,
1616+
# remove and bump tornado requirement for py38
1617+
# """
1618+
# if sys.platform.startswith("win") and sys.version_info >= (3, 8):
1619+
# import asyncio
1620+
# try:
1621+
# from asyncio import (
1622+
# WindowsProactorEventLoopPolicy,
1623+
# WindowsSelectorEventLoopPolicy,
1624+
# )
1625+
# except ImportError:
1626+
# pass
1627+
# # not affected
1628+
# else:
1629+
# if type(asyncio.get_event_loop_policy()) is WindowsProactorEventLoopPolicy:
1630+
# # WindowsProactorEventLoopPolicy is not compatible with tornado 6
1631+
# # fallback to the pre-3.8 default of Selector
1632+
# asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())
16321633

16331634
@catch_config_error
16341635
def initialize(self, argv=None, find_extensions=True, new_httpserver=True):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
],
3838
install_requires = [
3939
'jinja2',
40-
'tornado>=5.0',
40+
'tornado>=6.1.0',
4141
'pyzmq>=17',
4242
'ipython_genutils',
4343
'traitlets>=4.2.1',

0 commit comments

Comments
 (0)