diff options
author | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-11-24 11:13:14 +0100 |
---|---|---|
committer | Julien Jehannet <julien.jehannet@logilab.fr> | 2010-11-24 11:13:14 +0100 |
commit | aabeb00e58278290293505ec5b36536b50852f6d (patch) | |
tree | 643bf98e0139e34779acfb2dc2dc5652534a4e9b /clcommands.py | |
parent | 19a7ec4f5b3bdcb587263b32c2ee5ffea77fffff (diff) | |
download | logilab-common-aabeb00e58278290293505ec5b36536b50852f6d.tar.gz |
[clcommands] print keyboard interruption if any (useful in doctest)
Diffstat (limited to 'clcommands.py')
-rw-r--r-- | clcommands.py | 7 |
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 |