Skip to content

Commit

Permalink
Handle EarlyQuits and KeyboardInterrupts
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmavirus24 committed Jun 27, 2016
1 parent 7fe5b35 commit 95c373c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/flake8/main/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
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
Expand Down Expand Up @@ -291,6 +292,9 @@ def run(self, argv=None):
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')

0 comments on commit 95c373c

Please sign in to comment.