Show More
@@ -489,7 +489,7 b' class ZMQInteractiveShell(InteractiveShell):' | |||||
489 |
|
489 | |||
490 | def ask_exit(self): |
|
490 | def ask_exit(self): | |
491 | """Engage the exit actions.""" |
|
491 | """Engage the exit actions.""" | |
492 |
self.exit_now = |
|
492 | self.exit_now = (not self.keepkernel_on_exit) | |
493 | payload = dict( |
|
493 | payload = dict( | |
494 | source='ask_exit', |
|
494 | source='ask_exit', | |
495 | exit=True, |
|
495 | exit=True, |
@@ -137,11 +137,6 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||||
137 | if self.has_readline: |
|
137 | if self.has_readline: | |
138 | self.set_readline_completer() |
|
138 | self.set_readline_completer() | |
139 |
|
139 | |||
140 | def ask_exit(self): |
|
|||
141 | super(ZMQTerminalInteractiveShell, self).ask_exit() |
|
|||
142 | if self.exit_now and self.manager: |
|
|||
143 | self.client.shutdown() |
|
|||
144 |
|
||||
145 | def run_cell(self, cell, store_history=True): |
|
140 | def run_cell(self, cell, store_history=True): | |
146 | """Run a complete IPython cell. |
|
141 | """Run a complete IPython cell. | |
147 |
|
142 | |||
@@ -158,11 +153,7 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||||
158 | # pressing enter flushes any pending display |
|
153 | # pressing enter flushes any pending display | |
159 | self.handle_iopub() |
|
154 | self.handle_iopub() | |
160 | return |
|
155 | return | |
161 |
|
156 | |||
162 | if cell.strip() == 'exit': |
|
|||
163 | # explicitly handle 'exit' command |
|
|||
164 | return self.ask_exit() |
|
|||
165 |
|
||||
166 | # flush stale replies, which could have been ignored, due to missed heartbeats |
|
157 | # flush stale replies, which could have been ignored, due to missed heartbeats | |
167 | while self.client.shell_channel.msg_ready(): |
|
158 | while self.client.shell_channel.msg_ready(): | |
168 | self.client.shell_channel.get_msg() |
|
159 | self.client.shell_channel.get_msg() | |
@@ -213,6 +204,8 b' class ZMQTerminalInteractiveShell(TerminalInteractiveShell):' | |||||
213 | page.page(item['data']['text/plain']) |
|
204 | page.page(item['data']['text/plain']) | |
214 | elif source == 'set_next_input': |
|
205 | elif source == 'set_next_input': | |
215 | self.set_next_input(item['text']) |
|
206 | self.set_next_input(item['text']) | |
|
207 | elif source == 'ask_exit': | |||
|
208 | self.ask_exit() | |||
216 |
|
209 | |||
217 | elif status == 'error': |
|
210 | elif status == 'error': | |
218 | for frame in content["traceback"]: |
|
211 | for frame in content["traceback"]: |
General Comments 0
You need to be logged in to leave comments.
Login now