Skip to content

Commit beac94b

Browse files
impact27pre-commit-ci[bot]blink1073
authored
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 <[email protected]>
1 parent 5ffa3d4 commit beac94b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jupyter_client/threaded.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from typing import Optional
1515
from typing import Union
1616

17+
import nest_asyncio # type:ignore
1718
import zmq
1819
from traitlets import Instance
1920
from traitlets import Type
@@ -211,6 +212,7 @@ def run(self) -> None:
211212
"""Run my loop, ignoring EINTR events in the poller"""
212213
loop = asyncio.new_event_loop()
213214
asyncio.set_event_loop(loop)
215+
nest_asyncio.apply(loop)
214216
self.ioloop = ioloop.IOLoop()
215217
self.ioloop._asyncio_event_loop = loop
216218
# signal that self.ioloop is defined

0 commit comments

Comments
 (0)