Handle EarlyQuits and KeyboardInterrupts

This commit is contained in:
Ian Cordasco 2016-06-26 20:29:13 -05:00
parent 7fe5b359f7
commit 95c373cf11
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A

View file

@ -8,6 +8,7 @@ import time
import flake8
from flake8 import checker
from flake8 import defaults
from flake8 import exceptions
from flake8 import style_guide
from flake8 import utils
from flake8.main import options
@ -291,6 +292,9 @@ class Application(object):
try:
self._run(argv)
except KeyboardInterrupt as exc:
print('... stopped')
LOG.critical('Caught keyboard interrupt from user')
LOG.exception(exc)
self.file_checker_manager._force_cleanup()
except exceptions.EarlyQuit:
print('... stopped while processing files')