mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-44682: Handle invalid arg to pdb's "commands" directive (#27252)
This commit is contained in:
parent
cb1d76f10a
commit
53b9458f2e
3 changed files with 19 additions and 0 deletions
|
@ -640,6 +640,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
|||
except:
|
||||
self.error("Usage: commands [bnum]\n ...\n end")
|
||||
return
|
||||
try:
|
||||
self.get_bpbynumber(bnum)
|
||||
except ValueError as err:
|
||||
self.error('cannot set commands: %s' % err)
|
||||
return
|
||||
|
||||
self.commands_bnum = bnum
|
||||
# Save old definitions for the case of a keyboard interrupt.
|
||||
if bnum in self.commands:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue