Skip to content

Commit 45bdae5

Browse files
committed
only store the parent header in parent_headers
the old parent_header was actually the parent *message*, but we don't need to keep doing that
1 parent 31ec597 commit 45bdae5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ipykernel/inprocess/ipkernel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def _input_request(self, prompt, ident, parent, password=False):
9797
content = json_clean(dict(prompt=prompt, password=password))
9898
msg = self.session.msg('input_request', content, parent)
9999
for frontend in self.frontends:
100-
if frontend.session.session == parent['header']['session']:
100+
if frontend.session.session == parent['session']:
101101
frontend.stdin_channel.call_handlers(msg)
102102
break
103103
else:

ipykernel/kernelbase.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ def _parent_header(self):
142142
DeprecationWarning,
143143
stacklevel=2,
144144
)
145-
return self.get_parent_header(channel="shell")
145+
# _parent_header wasn't actually the header, it was the *message*
146+
# but only promised access to the header
147+
return {"header": self.get_parent_header(channel="shell")}
146148

147149
# Time to sleep after flushing the stdout/err buffers in each execute
148150
# cycle. While this introduces a hard limit on the minimal latency of the
@@ -538,6 +540,8 @@ def set_parent(self, ident, parent, channel='shell'):
538540
on the stdin channel.
539541
"""
540542
self._parent_ident[channel] = ident
543+
if parent and 'header' in parent:
544+
parent = parent['header']
541545
self._parent_headers[channel] = parent
542546

543547
def send_response(self, stream, msg_or_type, content=None, ident=None,

0 commit comments

Comments
 (0)