diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-20 19:23:43 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2013-02-20 19:23:43 +0100 |
commit | a663c2a2df35a09e9ec41460b5e5905ec16f576f (patch) | |
tree | aebc40837420cc7330dc5d956017cff9b0975c57 | |
parent | 4721b9dc22ba38fd13fc658c376462a167698b1c (diff) | |
parent | 8ddbc277c15d1abbb5f6f04ed03d0e722a617b6a (diff) | |
download | pep8-a663c2a2df35a09e9ec41460b5e5905ec16f576f.tar.gz |
Merge branch 'graceful-stop'
-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 4dc5631..ef70009 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,8 @@ Changelog * Read from standard input if no path is specified. +* 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 |