mirror of
https://github.com/python/cpython.git
synced 2025-07-28 13:44:43 +00:00
#1726198: replace while 1: fp.readline() with file iteration.
This commit is contained in:
parent
af67f303d8
commit
1ea8cb49ed
4 changed files with 4 additions and 14 deletions
|
@ -306,9 +306,7 @@ def test():
|
|||
except ImportError:
|
||||
from StringIO import StringIO
|
||||
fp = StringIO(test_input)
|
||||
while 1:
|
||||
line = fp.readline()
|
||||
if not line: break
|
||||
for line in fp:
|
||||
words = line.split()
|
||||
if not words:
|
||||
continue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue