else:
line = line.rstrip('\r\n')
buffer += '\n' + line
+ self.lastcmd = buffer
save_stdout = sys.stdout
save_stdin = sys.stdin
save_displayhook = sys.displayhook
... 'def f(x):',
... ' return x * 2',
... '',
- ... 'f(2)',
+ ... 'val = 2',
+ ... 'if val > 0:',
+ ... ' val = f(val)',
+ ... '',
+ ... '', # empty line should repeat the multi-line statement
+ ... 'val',
... 'c'
... ]):
... test_function()
(Pdb) def f(x):
... return x * 2
...
- (Pdb) f(2)
- 4
+ (Pdb) val = 2
+ (Pdb) if val > 0:
+ ... val = f(val)
+ ...
+ (Pdb)
+ (Pdb) val
+ 8
(Pdb) c
"""
--- /dev/null
+Fixed the bug in :mod:`pdb` where after a multi-line command, an empty line repeats the first line of the multi-line command, instead of the full command.