At exist operation that need to be called at most once. Second call to this function per instance will do nothing.
(self)
| 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 |
no test coverage detected