##// END OF EJS Templates
protect term console from empty parent header (startup messages)
MinRK -
Show More
@@ -142,7 +142,8 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):'
142 while self.km.sub_channel.msg_ready():
142 while self.km.sub_channel.msg_ready():
143 sub_msg = self.km.sub_channel.get_msg()
143 sub_msg = self.km.sub_channel.get_msg()
144 msg_type = sub_msg['header']['msg_type']
144 msg_type = sub_msg['header']['msg_type']
145 if self.session_id == sub_msg['parent_header']['session']:
145 parent = sub_msg["parent_header"]
146 if (not parent) or self.session_id == parent['session']:
146 if msg_type == 'status' :
147 if msg_type == 'status' :
147 if sub_msg["content"]["execution_state"] == "busy" :
148 if sub_msg["content"]["execution_state"] == "busy" :
148 pass
149 pass
@@ -172,7 +173,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):'
172 msg_rep = self.km.stdin_channel.get_msg(timeout=timeout)
173 msg_rep = self.km.stdin_channel.get_msg(timeout=timeout)
173 # in case any iopub came while we were waiting:
174 # in case any iopub came while we were waiting:
174 self.handle_iopub()
175 self.handle_iopub()
175 if self.session_id == msg_rep["parent_header"]["session"]:
176 if self.session_id == msg_rep["parent_header"].get("session"):
176 # wrap SIGINT handler
177 # wrap SIGINT handler
177 real_handler = signal.getsignal(signal.SIGINT)
178 real_handler = signal.getsignal(signal.SIGINT)
178 def double_int(sig,frame):
179 def double_int(sig,frame):
General Comments 0
You need to be logged in to leave comments. Login now