diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 5d1286b..b0e62ca 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -815,9 +815,9 @@ class Pdb(OldPdb): new_context = int(context) if new_context <= 0: raise ValueError() + self.context = new_context except ValueError: self.error("The 'context' command requires a positive integer argument.") - self.context = new_context class InterruptiblePdb(Pdb):