Skip to content

Commit 7aed569

Browse files
committed
Handle any kind of exception to clean up the pending task
1 parent 0cea299 commit 7aed569

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
@@ -21,9 +21,9 @@ def wrapped(*args, **kwargs):
2121
future = asyncio.ensure_future(coro(*args, **kwargs))
2222
try:
2323
return loop.run_until_complete(future)
24-
except KeyboardInterrupt:
24+
except BaseException as e:
2525
future.cancel()
26-
raise
26+
raise e
2727

2828
wrapped.__doc__ = coro.__doc__
2929
return wrapped

0 commit comments

Comments
 (0)