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

Method stop

IPython/core/history.py:1178–1191  ·  view source on GitHub ↗

This can be called from the main thread to safely stop this thread. Note that it does not attempt to write out remaining history before exiting. That should be done by calling the HistoryManager's end_session method.

(self)

Source from the content-addressed store, hash-verified

1176 atexit.unregister(self.stop)
1177
1178 def stop(self) -> None:
1179 """This can be called from the main thread to safely stop this thread.
1180
1181 Note that it does not attempt to write out remaining history before
1182 exiting. That should be done by calling the HistoryManager's
1183 end_session method."""
1184 if self._stopped:
1185 return
1186 self._stop_now = True
1187
1188 self.save_flag.set()
1189 self._stopped = True
1190 if self.ident is not None and self != threading.current_thread():
1191 self.join()
1192
1193 def __del__(self) -> None:
1194 self.stop()

Callers 10

__del__Method · 0.95
mainloopMethod · 0.80
inputhookFunction · 0.80
__del__Method · 0.80
_stop_threadMethod · 0.80
test_historyFunction · 0.80
test_hist_file_configFunction · 0.80
test_calling_run_cellFunction · 0.80

Calls 1

setMethod · 0.80

Tested by 5

test_historyFunction · 0.64
test_hist_file_configFunction · 0.64
test_calling_run_cellFunction · 0.64