MCPcopy Index your code
hub / github.com/ipython/ipython / _atexit_once

Method _atexit_once

IPython/core/interactiveshell.py:4091–4106  ·  view source on GitHub ↗

At exist operation that need to be called at most once. Second call to this function per instance will do nothing.

(self)

Source from the content-addressed store, hash-verified

4089 codeobj)
4090
4091 def _atexit_once(self):
4092 """
4093 At exist operation that need to be called at most once.
4094 Second call to this function per instance will do nothing.
4095 """
4096
4097 if not getattr(self, "_atexit_once_called", False):
4098 self._atexit_once_called = True
4099 # Clear all user namespaces to release all references cleanly.
4100 self.reset(new_session=False)
4101 # Close the history session (this stores the end time and line count)
4102 # this must be *before* the tempfile cleanup, in case of temporary
4103 # history db
4104 if self.history_manager is not None:
4105 self.history_manager.end_session()
4106 self.history_manager = None
4107
4108 #-------------------------------------------------------------------------
4109 # Things related to IPython exiting

Callers 2

atexit_operationsMethod · 0.95
mainloopMethod · 0.80

Calls 2

resetMethod · 0.95
end_sessionMethod · 0.80

Tested by

no test coverage detected