summaryrefslogtreecommitdiff
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2016-01-02 15:43:44 -0500
committerR David Murray <rdmurray@bitdance.com>2016-01-02 15:43:44 -0500
commit01759d55547c4f39d451f4063d51fd309744f3ea (patch)
tree8574fcc248b0b6143ccfd65a438096ecf216bdca /Lib/fileinput.py
parent5b3455c793228b6f323dce18551a81f87e46fbb7 (diff)
parent830207e8f32df949ec35e2e7f5afe98975e262c9 (diff)
downloadcpython-git-01759d55547c4f39d451f4063d51fd309744f3ea.tar.gz
Merge: #22709: Use stdin as-is if it does not have a buffer attribute.
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index c41b94abff..021e39f83a 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -328,7 +328,7 @@ class FileInput:
if self._filename == '-':
self._filename = '<stdin>'
if 'b' in self._mode:
- self._file = sys.stdin.buffer
+ self._file = getattr(sys.stdin, 'buffer', sys.stdin)
else:
self._file = sys.stdin
self._isstdin = True