%exit_raise Make the current embedded kernel exit and raise and exception. This function sets an internal flag so that an embedded IPython will raise a `IPython.terminal.embed.KillEmbedded` Exception on exit, and then exit the current I. This is useful to permanently exit a
(self, parameter_s='')
| 96 | |
| 97 | @line_magic |
| 98 | def exit_raise(self, parameter_s=''): |
| 99 | """%exit_raise Make the current embedded kernel exit and raise and exception. |
| 100 | |
| 101 | This function sets an internal flag so that an embedded IPython will |
| 102 | raise a `IPython.terminal.embed.KillEmbedded` Exception on exit, and then exit the current I. This is |
| 103 | useful to permanently exit a loop that create IPython embed instance. |
| 104 | """ |
| 105 | |
| 106 | self.shell.should_raise = True |
| 107 | self.shell.ask_exit() |
| 108 | |
| 109 | |
| 110 | class _Sentinel: |