##// END OF EJS Templates
qtconsole with pure python kernel now properly catches the SystemExit exception, allowing python exit() function to work correctly
Erik Tollerud -
Show More
@@ -546,8 +546,16 b' class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):'
546 """ Process a reply for an execution request that resulted in an error.
546 """ Process a reply for an execution request that resulted in an error.
547 """
547 """
548 content = msg['content']
548 content = msg['content']
549 traceback = ''.join(content['traceback'])
549 # If a SystemExit is passed along, this means exit() was called - also
550 self._append_plain_text(traceback)
550 # all the ipython %exit magic syntax of '-k' to be used to keep
551 # the kernel running
552 if content['ename']=='SystemExit':
553 keepkernel = content['evalue']=='-k' or content['evalue']=='True'
554 self._keep_kernel_on_exit = keepkernel
555 self.exit_requested.emit()
556 else:
557 traceback = ''.join(content['traceback'])
558 self._append_plain_text(traceback)
551
559
552 def _process_execute_ok(self, msg):
560 def _process_execute_ok(self, msg):
553 """ Process a reply for a successful execution equest.
561 """ Process a reply for a successful execution equest.
General Comments 0
You need to be logged in to leave comments. Login now