mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #25510: fileinput.FileInput.readline() now returns b'' instead of ''
at the end if the FileInput was opened with binary mode. Patch by Ryosuke Ito.
This commit is contained in:
commit
56275dc1e2
3 changed files with 23 additions and 1 deletions
|
@ -315,7 +315,10 @@ class FileInput:
|
|||
return line
|
||||
if not self._file:
|
||||
if not self._files:
|
||||
return ""
|
||||
if 'b' in self._mode:
|
||||
return b''
|
||||
else:
|
||||
return ''
|
||||
self._filename = self._files[0]
|
||||
self._files = self._files[1:]
|
||||
self._filelineno = 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue