Skip to content

Commit fda1156

Browse files
authored
Merge pull request #673 from marcoamonteiro/keyboard-interrupt-handler
fix keyboard interrupt issue in dispatch_shell
2 parents 3fbbd1c + 4c3ef6f commit fda1156

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ipykernel/kernelbase.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,9 @@ async def dispatch_shell(self, msg):
352352
await result
353353
except Exception:
354354
self.log.error("Exception in message handler:", exc_info=True)
355+
except KeyboardInterrupt:
356+
# Ctrl-c shouldn't crash the kernel here.
357+
self.log.error("KeyboardInterrupt caught in kernel.")
355358
finally:
356359
try:
357360
self.post_handler_hook()

0 commit comments

Comments
 (0)