summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWinston Weinert <winston@ml1.net>2014-04-18 03:26:29 -0500
committerWinston Weinert <winston@ml1.net>2014-04-18 03:28:59 -0500
commit69e2b69c7cef4b243c119686d6354f6c33f51735 (patch)
tree32f99e5c7866008a3ed7767cf525b699d665e2a6
parentb14a97e5753b9c63794b76a8ef66ef9a03186b79 (diff)
downloadpep8-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-xpep8.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/pep8.py b/pep8.py
index 2c683ab..1e52c3e 100755
--- a/pep8.py
+++ b/pep8.py
@@ -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