##// END OF EJS Templates
fix to minrk suggestion
Matthias BUSSONNIER -
Show More
@@ -374,10 +374,8 class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):
374 374 """ Handles replies for code execution.
375 375 """
376 376 self.log.debug("execute: %s", msg.get('content', ''))
377 info_list = self._request_info.get('execute')
378 377 msg_id = msg['parent_header']['msg_id']
379 if msg_id in info_list:
380 info = info_list[msg_id]
378 info = self._request_info['execute'].get(msg_id)
381 379 # unset reading flag, because if execute finished, raw_input can't
382 380 # still be pending.
383 381 self._reading = False
@@ -403,7 +401,7 class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):
403 401
404 402 self._show_interpreter_prompt_for_reply(msg)
405 403 self.executed.emit(msg)
406 info_list.pop(msg_id)
404 self._request_info['execute'].pop(msg_id)
407 405 elif info and info.kind == 'silent_exec_callback' and not self._hidden:
408 406 self._handle_exec_callback(msg)
409 407 else:
@@ -216,11 +216,9 class HistoryConsoleWidget(ConsoleWidget):
216 216 def _handle_execute_reply(self, msg):
217 217 """ Handles replies for code execution, here only session history length
218 218 """
219 info_list = self._request_info.get('execute')
220 219 msg_id = msg['parent_header']['msg_id']
221 if msg_id in info_list:
222 info = info_list.pop(msg_id)
223 if info.kind == 'save_magic' and not self._hidden:
220 info = self._request_info.get['execute'].pop(msg_id,None)
221 if info and info.kind == 'save_magic' and not self._hidden:
224 222 content = msg['content']
225 223 status = content['status']
226 224 if status == 'ok':
@@ -165,14 +165,12 class IPythonWidget(FrontendWidget):
165 165 def _handle_execute_reply(self, msg):
166 166 """ Reimplemented to support prompt requests.
167 167 """
168 info_list = self._request_info.get('execute')
169 msg_id = msg['parent_header']['msg_id']
170 if msg_id in info_list:
171 info = info_list[msg_id]
172 if info.kind == 'prompt':
168 msg_id = msg['parent_header'].get('msg_id')
169 info = self._request_info['execute'].get(msg_id)
170 if info and info.kind == 'prompt':
173 171 number = msg['content']['execution_count'] + 1
174 172 self._show_interpreter_prompt(number)
175 info_list.pop(msg_id)
173 self._request_info['execute'].pop(msg_id)
176 174 else:
177 175 super(IPythonWidget, self)._handle_execute_reply(msg)
178 176
General Comments 0
You need to be logged in to leave comments. Login now