summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Jehannet <julien.jehannet@logilab.fr>2010-11-24 11:13:14 +0100
committerJulien Jehannet <julien.jehannet@logilab.fr>2010-11-24 11:13:14 +0100
commitaabeb00e58278290293505ec5b36536b50852f6d (patch)
tree643bf98e0139e34779acfb2dc2dc5652534a4e9b
parent19a7ec4f5b3bdcb587263b32c2ee5ffea77fffff (diff)
downloadlogilab-common-aabeb00e58278290293505ec5b36536b50852f6d.tar.gz
[clcommands] print keyboard interruption if any (useful in doctest)
-rw-r--r--clcommands.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/clcommands.py b/clcommands.py
index d061dce..92a566a 100644
--- a/clcommands.py
+++ b/clcommands.py
@@ -126,8 +126,11 @@ class CommandLine(dict):
self.usage_and_exit(1)
try:
sys.exit(command.main_run(args, rcfile))
- except KeyboardInterrupt:
- print 'interrupted'
+ except KeyboardInterrupt, exc:
+ print 'Interrupted',
+ if str(exc):
+ print ': %s' % exc,
+ print
sys.exit(4)
except BadCommandUsage, err:
print 'ERROR:', err