Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: prevent hanging PDB on interact (#4852)

Dylan Madisetti63dfa9d8eebc
diff --git a/marimo/_runtime/marimo_pdb.py b/marimo/_runtime/marimo_pdb.py
index 0a4faead76..7ab95f6af9 100644
--- a/marimo/_runtime/marimo_pdb.py
+++ b/marimo/_runtime/marimo_pdb.py
@@ -71,6 +71,16 @@ class MarimoPdb(Pdb):
self.reset()
self.interaction(None, t)
+ def do_interact(self, arg: Any) -> None:
+ """Interact
+
+ Catch interact to avoid SystemExit exceptions from hanging the kernel.
+ """
+ try:
+ super().do_interact(arg)
+ except SystemExit:
+ pass
+
def set_trace(
debugger: MarimoPdb,