Skip to content

Commit 0a2c228

Browse files
committed
work around event loop limitation
1 parent dc8d412 commit 0a2c228

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jupyter_client/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def wrapped(*args, **kwargs):
1313
try:
1414
loop = asyncio.get_running_loop()
1515
except RuntimeError:
16-
loop = asyncio.new_event_loop()
17-
asyncio.set_event_loop(loop)
16+
# Workaround for bugs.python.org/issue39529.
17+
loop = asyncio.get_event_loop_policy().get_event_loop()
1818
import nest_asyncio # type: ignore
1919

2020
nest_asyncio.apply(loop)

0 commit comments

Comments
 (0)