summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-12-09 13:47:02 -0800
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-12-09 13:47:02 -0800
commitbc8ec1877bb9a5c67d856c662e3fa70c17dbf3a7 (patch)
treed0ea9ef4e0219b03ccdabee1570631b31a502865
parent46018e052ee8f2512370dbe22f153c0873a2325e (diff)
parentcc4d7e0da8c26dc6607209f9e34fc44c1133a758 (diff)
downloadpep8-bc8ec1877bb9a5c67d856c662e3fa70c17dbf3a7.tar.gz
Merge pull request #128 from yole/input-from-stdin
accept '-' as input filename to read data for checking from standard input
-rwxr-xr-xpep8.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/pep8.py b/pep8.py
index 1e6e3ba..1a85cee 100755
--- a/pep8.py
+++ b/pep8.py
@@ -1182,6 +1182,9 @@ class Checker(object):
if filename is None:
self.filename = 'stdin'
self.lines = lines or []
+ elif filename == '-':
+ self.filename = 'stdin'
+ self.lines = stdin_get_value().splitlines(True)
elif lines is None:
try:
self.lines = readlines(filename)