Skip to content

Commit cb558be

Browse files
author
Golf Player
committed
Got the if condition backwards....
1 parent c746c8f commit cb558be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

nbclient/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ async def ensure_async(obj: Union[Awaitable, Any]) -> Any:
9696
def run_hook(hook, *args):
9797
if hook is None:
9898
return
99-
if inspect.isawaitable(hook):
99+
if not inspect.isawaitable(hook):
100+
future = hook(*args)
101+
else:
100102
loop = asyncio.get_event_loop()
101103
future = loop.run_in_executor(None, hook, *args)
102-
else:
103-
future = hook(*args)
104104
asyncio.ensure_future(future)

0 commit comments

Comments
 (0)