diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-14 20:01:13 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-14 20:01:13 +0100 |
commit | 8ddbc277c15d1abbb5f6f04ed03d0e722a617b6a (patch) | |
tree | 40ef8ac8ab7e4fe88670b58051044bb56f3bb458 | |
parent | 9dfb34e7d833c9a417a28737425de7cd34f59186 (diff) | |
download | pep8-8ddbc277c15d1abbb5f6f04ed03d0e722a617b6a.tar.gz |
Initiate a graceful shutdown on Ctrl+C
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index a2decfb..756e111 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -9,6 +9,8 @@ Changelog * Fix crash with AST checkers when the syntax is invalid. (Issue #160) +* Initiate a graceful shutdown on ``Control+C``. + 1.4.2 (2013-02-10) ------------------ @@ -1603,11 +1603,14 @@ class StyleGuide(object): report = self.options.report runner = self.runner report.start() - for path in paths: - if os.path.isdir(path): - self.input_dir(path) - elif not self.excluded(path): - runner(path) + try: + for path in paths: + if os.path.isdir(path): + self.input_dir(path) + elif not self.excluded(path): + runner(path) + except KeyboardInterrupt: + print('... stopped') report.stop() return report |