Skip to content

Commit 7a02a56

Browse files
authored
Merge pull request #35 from davidbrochart/fix_nested_loop
Fix nested event loops execution
2 parents 507876f + 56a1b04 commit 7a02a56

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

nbclient/client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
# contextlib, and we `await yield_()` instead of just `yield`
77
from async_generator import asynccontextmanager, async_generator, yield_
88

9+
import nest_asyncio
10+
911
from time import monotonic
1012
from queue import Empty
1113
import asyncio
@@ -816,3 +818,6 @@ def get_loop():
816818
loop = asyncio.new_event_loop()
817819
asyncio.set_event_loop(loop)
818820
return loop
821+
822+
823+
nest_asyncio.apply()

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ traitlets>=4.2
22
jupyter_client>=6.0.0
33
nbformat>=5.0
44
async_generator
5+
nest_asyncio

0 commit comments

Comments
 (0)