diff options
author | andrei kulakov <andrei.avk@gmail.com> | 2021-07-28 16:55:03 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-28 16:55:03 (GMT) |
commit | 53b9458f2e9314703a5406ca817d757f1509882a (patch) | |
tree | 19dd435240b7889eafbe710a528c381e95329c1a /Lib/pdb.py | |
parent | cb1d76f10ab33dddd0dbd64e6506bf7c065d499b (diff) | |
download | cpython-53b9458f2e9314703a5406ca817d757f1509882a.zip cpython-53b9458f2e9314703a5406ca817d757f1509882a.tar.gz cpython-53b9458f2e9314703a5406ca817d757f1509882a.tar.bz2 |
bpo-44682: Handle invalid arg to pdb's "commands" directive (#27252)
Diffstat (limited to 'Lib/pdb.py')
-rwxr-xr-x | Lib/pdb.py | 6 |
1 files changed, 6 insertions, 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: |