diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index 0d0b71e..ca0c1f4 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -620,7 +620,11 @@ class Pdb(OldPdb): Take a number as argument as an (optional) number of context line to print""" if arg: - context = int(arg) + try: + context = int(arg) + except ValueError as err: + self.error(err) + return self.print_stack_trace(context) else: self.print_stack_trace()