diff options
author | Winston Weinert <winston@ml1.net> | 2014-04-18 03:26:29 -0500 |
---|---|---|
committer | Winston Weinert <winston@ml1.net> | 2014-04-18 03:28:59 -0500 |
commit | 69e2b69c7cef4b243c119686d6354f6c33f51735 (patch) | |
tree | 32f99e5c7866008a3ed7767cf525b699d665e2a6 | |
parent | b14a97e5753b9c63794b76a8ef66ef9a03186b79 (diff) | |
download | pep8-69e2b69c7cef4b243c119686d6354f6c33f51735.tar.gz |
Handle broken pipe in check_files()
This way partial output (e.g. "pep8 . | head") doesn't get clobbered with a
stacktrace on stderr.
-rwxr-xr-x | pep8.py | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -55,6 +55,7 @@ import time import inspect import keyword import tokenize +import errno from optparse import OptionParser from fnmatch import fnmatch try: @@ -1672,6 +1673,9 @@ class StyleGuide(object): runner(path) except KeyboardInterrupt: print('... stopped') + except IOError as e: + if e.errno != errno.EPIPE: + raise e report.stop() return report |