Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit e44a670

Browse filesBrowse files
committed
End commands entry on 'end' and ^C and ^D
1 parent 90e0a81 commit e44a670
Copy full SHA for e44a670

File tree

Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-2
lines changed

‎Lib/pdb.py

Copy file name to clipboardExpand all lines: Lib/pdb.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2706,6 +2706,7 @@ def do_commands(self, arg):
27062706
]
27072707
# fmt: on
27082708

2709+
end_cmds += ["end"] # pseudo-command
27092710
self._send(commands_entry={"bpnum": bnum, "terminators": end_cmds})
27102711
return
27112712

@@ -2875,8 +2876,10 @@ def prompt_for_breakpoint_command_list(self, prompt):
28752876
cmd = self.pdb_instance.parseline(line)[0]
28762877
if cmd in self.command_list_terminators:
28772878
break
2878-
except EOFError:
2879-
return
2879+
except (KeyboardInterrupt, EOFError):
2880+
print(flush=True)
2881+
print("command definition aborted, old commands restored")
2882+
break
28802883
finally:
28812884
self.commands_mode = False
28822885

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.