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 5306c3f commit fc093eeCopy full SHA for fc093ee
nbclient/util.py
@@ -94,9 +94,9 @@ async def ensure_async(obj):
94
def run_hook(hook, *args):
95
if hook is None:
96
return
97
- if inspect.isawaitable(hook):
+ if not inspect.isawaitable(hook):
98
+ future = hook(*args)
99
+ else:
100
loop = asyncio.get_event_loop()
101
future = loop.run_in_executor(None, hook, *args)
- else:
- future = hook(*args)
102
asyncio.ensure_future(future)
0 commit comments