From 95c373cf112d7415341e97116abacf32757a9391 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Sun, 26 Jun 2016 20:29:13 -0500 Subject: [PATCH] Handle EarlyQuits and KeyboardInterrupts --- src/flake8/main/application.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flake8/main/application.py b/src/flake8/main/application.py index 225c701..ef31713 100644 --- a/src/flake8/main/application.py +++ b/src/flake8/main/application.py @@ -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')