From f29b47050ab2197d8bbfd9a9bc59f03294bd89df 2020-04-18 21:40:56 From: Matthias Bussonnier Date: 2020-04-18 21:40:56 Subject: [PATCH] Backport PR #12219: Catch ValueError --- diff --git a/IPython/core/debugger.py b/IPython/core/debugger.py index ebb8dca..5c2887f 100644 --- a/IPython/core/debugger.py +++ b/IPython/core/debugger.py @@ -622,7 +622,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()