File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -509,16 +509,18 @@ def onecmd(self, line):
509509 return self .handle_command_def (line )
510510
511511 def handle_command_def (self ,line ):
512- """ Handles one command line during command list definition. """
512+ """Handles one command line during command list definition."""
513513 cmd , arg , line = self .parseline (line )
514+ if not cmd :
515+ return
514516 if cmd == 'silent' :
515517 self .commands_silent [self .commands_bnum ] = True
516518 return # continue to handle other cmd def in the cmd list
517519 elif cmd == 'end' :
518520 self .cmdqueue = []
519521 return 1 # end of cmd list
520522 cmdlist = self .commands [self .commands_bnum ]
521- if ( arg ) :
523+ if arg :
522524 cmdlist .append (cmd + ' ' + arg )
523525 else :
524526 cmdlist .append (cmd )
@@ -561,9 +563,11 @@ def do_commands(self, arg):
561563 prompt_back = self .prompt
562564 self .prompt = '(com) '
563565 self .commands_defining = True
564- self .cmdloop ()
565- self .commands_defining = False
566- self .prompt = prompt_back
566+ try :
567+ self .cmdloop ()
568+ finally :
569+ self .commands_defining = False
570+ self .prompt = prompt_back
567571
568572 def do_break (self , arg , temporary = 0 ):
569573 # break [ ([filename:]lineno | function) [, "condition"] ]
Original file line number Diff line number Diff line change @@ -475,6 +475,9 @@ C-API
475475Library
476476-------
477477
478+ - Issue #8015: In pdb, do not crash when an empty line is entered as
479+ a breakpoint command.
480+
478481- In pdb, allow giving a line number to the "until" command.
479482
480483- Issue #1437051: For pdb, allow "continue" and related commands in
You can’t perform that action at this time.
0 commit comments