From beac94baac163015e8165fde5661aaf026e92364 Mon Sep 17 00:00:00 2001 From: Quentin Peter Date: Sun, 4 Dec 2022 03:41:15 +0100 Subject: [PATCH] Make sure loop is marked with nest_asyncio (#893) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Silvester --- jupyter_client/threaded.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jupyter_client/threaded.py b/jupyter_client/threaded.py index 6c46219d0..f5b3f3773 100644 --- a/jupyter_client/threaded.py +++ b/jupyter_client/threaded.py @@ -14,6 +14,7 @@ from typing import Optional from typing import Union +import nest_asyncio # type:ignore import zmq from traitlets import Instance from traitlets import Type @@ -211,6 +212,7 @@ def run(self) -> None: """Run my loop, ignoring EINTR events in the poller""" loop = asyncio.new_event_loop() asyncio.set_event_loop(loop) + nest_asyncio.apply(loop) self.ioloop = ioloop.IOLoop() self.ioloop._asyncio_event_loop = loop # signal that self.ioloop is defined