gh-104301: Allow leading whitespace in disambiguated pdb statements (#104342)

This commit is contained in:
James Gerity 2023-05-11 13:12:02 -04:00 committed by GitHub
parent 27419a71b5
commit 0449ffe3a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 12 deletions

View file

@ -440,7 +440,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
self.message(repr(obj))
def default(self, line):
if line[:1] == '!': line = line[1:]
if line[:1] == '!': line = line[1:].strip()
locals = self.curframe_locals
globals = self.curframe.f_globals
try:
@ -1642,9 +1642,12 @@ class Pdb(bdb.Bdb, cmd.Cmd):
Execute the (one-line) statement in the context of the current
stack frame. The exclamation point can be omitted unless the
first word of the statement resembles a debugger command. To
assign to a global variable you must always prefix the command
with a 'global' command, e.g.:
first word of the statement resembles a debugger command, e.g.:
(Pdb) ! n=42
(Pdb)
To assign to a global variable you must always prefix the command with
a 'global' command, e.g.:
(Pdb) global list_options; list_options = ['-l']
(Pdb)
"""