From d19f59df7b55770c7a6c322f77d86467023e6fa6 2020-10-21 14:29:48 From: Quentin Peter Date: 2020-10-21 14:29:48 Subject: [PATCH] Fix settrace for recursive debugger --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 54074ca..ff9e2b5 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -588,6 +588,7 @@ class Pdb(OldPdb): argument (which is an arbitrary expression or statement to be executed in the current environment). """ + trace_function = sys.gettrace() sys.settrace(None) globals = self.curframe.f_globals locals = self.curframe_locals @@ -598,7 +599,7 @@ class Pdb(OldPdb): self.message("ENTERING RECURSIVE DEBUGGER") sys.call_tracing(p.run, (arg, globals, locals)) self.message("LEAVING RECURSIVE DEBUGGER") - sys.settrace(self.trace_dispatch) + sys.settrace(trace_function) self.lastcmd = p.lastcmd def do_pdef(self, arg):