diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 1f0d7b2..76c42e0 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -550,7 +550,7 @@ class Pdb(OldPdb): So if frame is self.current_frame we instead return self.curframe_locals """ - if frame is self.curframe: + if frame is getattr(self, "curframe", None): return self.curframe_locals else: return frame.f_locals