mirror of
https://github.com/python/cpython.git
synced 2025-11-25 21:11:09 +00:00
gh-104301: Allow leading whitespace in disambiguated pdb statements (#104342)
This commit is contained in:
parent
27419a71b5
commit
0449ffe3a4
5 changed files with 50 additions and 12 deletions
11
Lib/pdb.py
11
Lib/pdb.py
|
|
@ -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)
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue