[Jupyter Debugger] PY-83718 Destroy a debug process not after .connect but to .disconnect #PY-83718 Ready for Merge

* [Kotlin] Moved process destruction to `executeAfterCell`
* [Kotlin] Fixed the readAccess exception in logging and re-wrote a log message
* [Python] Changed PyDB disposing in accordance with a new approach
* [Python] Removed unnecessary kill_all_pydev_threads python method

GitOrigin-RevId: f3191c47cabc37c62738ee4def6c0a3181a325b6
This commit is contained in:
Natalia.Murycheva
2025-08-28 19:55:58 +00:00
committed by intellij-monorepo-bot
parent d4eb16ecad
commit 1bba6de754
3 changed files with 3 additions and 18 deletions
@@ -105,14 +105,9 @@ def enable_tracing():
def disable_tracing():
ipython_shell = get_ipython()
if hasattr(ipython_shell, "debugger"):
ipython_shell.debugger.disable_tracing()
kill_pydev_threads(ipython_shell.debugger)
def kill_pydev_threads(py_db):
from _pydevd_bundle.pydevd_kill_all_pydevd_threads import kill_all_pydev_threads
py_db.finish_debugging_session()
kill_all_pydev_threads()
py_db = ipython_shell.debugger
py_db.disable_tracing()
py_db.dispose_and_kill_all_pydevd_threads()
def is_cell_filename(filename):
@@ -108,7 +108,6 @@ DONT_TRACE = {
'pydevd_import_class.py': PYDEV_FILE,
'pydevd_io.py': PYDEV_FILE,
'pydevd_ipython_console_output.py': PYDEV_FILE,
'pydevd_kill_all_pydevd_threads.py': PYDEV_FILE,
'pydevd_matplotlib_image.py': PYDEV_FILE,
'pydevd_modify_bytecode.py': PYDEV_FILE,
'pydevd_numpy.py': PYDEV_FILE,
@@ -1,9 +0,0 @@
from _pydevd_bundle.pydevd_comm import PyDBDaemonThread
from _pydevd_bundle.pydevd_constants import dict_keys
def kill_all_pydev_threads():
threads = dict_keys(PyDBDaemonThread.created_pydb_daemon_threads)
for t in threads:
if hasattr(t, 'do_kill_pydev_thread'):
t.do_kill_pydev_thread()