Skip to content

Commit e2b522c

Browse files
committed
call metadata methods on abort replies
ensures aborted messages have consistent metadata with real replies
1 parent fda1156 commit e2b522c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ipykernel/kernelbase.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ async def dispatch_shell(self, msg):
354354
self.log.error("Exception in message handler:", exc_info=True)
355355
except KeyboardInterrupt:
356356
# Ctrl-c shouldn't crash the kernel here.
357-
self.log.error("KeyboardInterrupt caught in kernel.")
357+
self.log.error("KeyboardInterrupt caught in kernel.")
358358
finally:
359359
try:
360360
self.post_handler_hook()
@@ -925,8 +925,10 @@ def _send_abort_reply(self, stream, msg, idents):
925925
self.log.info("%s", msg)
926926
reply_type = msg["header"]["msg_type"].rsplit("_", 1)[0] + "_reply"
927927
status = {"status": "aborted"}
928-
md = {"engine": self.ident}
928+
md = self.init_metadata(msg)
929+
md = self.finish_metadata(msg, md, status)
929930
md.update(status)
931+
930932
self.session.send(
931933
stream, reply_type, metadata=md,
932934
content=status, parent=msg, ident=idents,

0 commit comments

Comments
 (0)