display nice message on SIGINT
This commit is contained in:
parent
1b7514dbfd
commit
12908c01c5
1 changed files with 4 additions and 1 deletions
|
|
@ -104,4 +104,7 @@ class BaseApplication(object):
|
|||
level = logging.WARNING
|
||||
log_format = '%(asctime)s:%(levelname)s:%(filename)s:%(lineno)d %(message)s'
|
||||
logging.basicConfig(stream=sys.stdout, level=level, format=log_format)
|
||||
sys.exit(app.main(args))
|
||||
try:
|
||||
sys.exit(app.main(args))
|
||||
except KeyboardInterrupt:
|
||||
print 'Program killed by SIGINT'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue