Merge lp://qastaging/~benoit.pierre/bzrtools/shell_improvement_kbd_interrupt into lp://qastaging/bzrtools

Proposed by Benoit Pierre
Status: Merged
Merged at revision: not available
Proposed branch: lp://qastaging/~benoit.pierre/bzrtools/shell_improvement_kbd_interrupt
Merge into: lp://qastaging/bzrtools
Diff against target: None lines
To merge this branch: bzr merge lp://qastaging/~benoit.pierre/bzrtools/shell_improvement_kbd_interrupt
Reviewer Review Type Date Requested Status
Aaron Bentley Approve
Review via email: mp+12187@code.qastaging.launchpad.net
To post a comment you must log in.
Revision history for this message
Aaron Bentley (abentley) wrote :

Looks good. At first, I thought the order should be reversed so that a KeyboardInterrupt caused prompt.write_history to be executed, but the history is remembered, so that's not needed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'shell.py'
--- shell.py 2008-02-13 04:58:32 +0000
+++ shell.py 2009-09-21 19:31:17 +0000
@@ -223,10 +223,14 @@
223def run_shell():223def run_shell():
224 try:224 try:
225 prompt = PromptCmd()225 prompt = PromptCmd()
226 try:226 while True:
227 prompt.cmdloop()227 try:
228 finally:228 try:
229 prompt.write_history()229 prompt.cmdloop()
230 except KeyboardInterrupt:
231 print
232 finally:
233 prompt.write_history()
230 except StopIteration:234 except StopIteration:
231 pass235 pass
232236

Subscribers

People subscribed via source and target branches