mirror of
https://github.com/python/cpython.git
synced 2025-12-11 03:20:01 +00:00
fix formatting of stack entries
This commit is contained in:
parent
08e767bdc5
commit
b6aa92ebf1
2 changed files with 8 additions and 5 deletions
|
|
@ -253,8 +253,12 @@ class Bdb: # Basic Debugger
|
||||||
s = s + "<lambda>"
|
s = s + "<lambda>"
|
||||||
if frame.f_locals.has_key('__args__'):
|
if frame.f_locals.has_key('__args__'):
|
||||||
args = frame.f_locals['__args__']
|
args = frame.f_locals['__args__']
|
||||||
if args is not None:
|
else:
|
||||||
s = s + repr.repr(args)
|
args = None
|
||||||
|
if args:
|
||||||
|
s = s + repr.repr(args)
|
||||||
|
else:
|
||||||
|
s = s + '()'
|
||||||
if frame.f_locals.has_key('__return__'):
|
if frame.f_locals.has_key('__return__'):
|
||||||
rv = frame.f_locals['__return__']
|
rv = frame.f_locals['__return__']
|
||||||
s = s + '->'
|
s = s + '->'
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
||||||
|
|
||||||
def interaction(self, frame, traceback):
|
def interaction(self, frame, traceback):
|
||||||
self.setup(frame, traceback)
|
self.setup(frame, traceback)
|
||||||
self.print_stack_entry(self.stack[self.curindex],
|
self.print_stack_entry(self.stack[self.curindex])
|
||||||
line_prefix)
|
|
||||||
self.cmdloop()
|
self.cmdloop()
|
||||||
self.forget()
|
self.forget()
|
||||||
|
|
||||||
|
|
@ -288,7 +287,7 @@ class Pdb(bdb.Bdb, cmd.Cmd):
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def print_stack_entry(self, frame_lineno, prompt_prefix=''):
|
def print_stack_entry(self, frame_lineno, prompt_prefix=line_prefix):
|
||||||
frame, lineno = frame_lineno
|
frame, lineno = frame_lineno
|
||||||
if frame is self.curframe:
|
if frame is self.curframe:
|
||||||
print '>',
|
print '>',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue