even latest jupyter-server requires current event loop

for nbconvert handler lock
This commit is contained in:
Min RK
2022-07-29 15:31:50 +02:00
parent 8548472b6e
commit ab3a01b9f6

View File

@@ -656,14 +656,13 @@ class SingleUserNotebookAppMixin(Configurable):
# running, use IOLoop.current
self.io_loop = ioloop.IOLoop.current()
for cls in self.__class__.mro():
if cls.__module__.startswith("notebook."):
# notebookapp unconditionally calls `self.io_loop = IOLoop.current()` in start.
# To avoid problems, we must make sure our event loop is current.
# this is not required for jupyter-server.
with warnings.catch_warnings():
warnings.simplefilter("ignore")
self.io_loop.make_current()
# Make our event loop the 'current' event loop.
# FIXME: this shouldn't be necessary, but it is.
# notebookapp (<=6.4, at least), and
# jupyter-server (<=1.17.0, at least) still need the 'current' event loop to be defined
with warnings.catch_warnings():
warnings.simplefilter("ignore")
self.io_loop.make_current()
def init_httpserver(self):
self.io_loop.run_sync(super().init_httpserver)