Skip to content

Commit

Permalink
Make sure loop is marked with nest_asyncio (jupyter#893)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
  • Loading branch information
3 people authored Dec 4, 2022
1 parent 5ffa3d4 commit beac94b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jupyter_client/threaded.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit beac94b

Please sign in to comment.