MCPcopy Create free account
hub / github.com/ipython/ipython / exit_raise

Method exit_raise

IPython/terminal/embed.py:97–106  ·  view source on GitHub ↗

%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='')

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

ask_exitMethod · 0.80

Tested by

no test coverage detected