We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 06f8ba2 commit 7bddf0aCopy full SHA for 7bddf0a
nbclient/client.py
@@ -319,7 +319,16 @@ def run_blocking(self, coro):
319
if self.nest_asyncio:
320
import nest_asyncio
321
nest_asyncio.apply(loop)
322
- result = loop.run_until_complete(coro)
+ try:
323
+ result = loop.run_until_complete(coro)
324
+ except RuntimeError as e:
325
+ if str(e) == 'This event loop is already running':
326
+ raise RuntimeError(
327
+ 'You are trying to run nbclient in an environment where an '
328
+ 'event loop is already running. Please pass `nest_asyncio=True` in '
329
+ '`NotebookClient.execute` and such methods.'
330
+ )
331
+ raise
332
return result
333
334
def reset_execution_trackers(self):
0 commit comments