summaryrefslogtreecommitdiffstats
path: root/Lib/fileinput.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/fileinput.py')
-rw-r--r--Lib/fileinput.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/fileinput.py b/Lib/fileinput.py
index de29518..87758ad 100644
--- a/Lib/fileinput.py
+++ b/Lib/fileinput.py
@@ -320,7 +320,10 @@ class FileInput:
self._backupfilename = 0
if self._filename == '-':
self._filename = '<stdin>'
- self._file = sys.stdin
+ if 'b' in self._mode:
+ self._file = sys.stdin.buffer
+ else:
+ self._file = sys.stdin
self._isstdin = True
else:
if self._inplace: