Commit 1ea8cb49 authored by Georg Brandl's avatar Georg Brandl

#1726198: replace while 1: fp.readline() with file iteration.

parent af67f303
......@@ -432,10 +432,7 @@ def test(file = None):
fp = open(sys.argv[1])
else:
fp = sys.stdin
while 1:
line = fp.readline()
if not line:
break
for line in fp:
if line == '\n':
f.end_paragraph(1)
else:
......
......@@ -62,9 +62,7 @@ def main():
fp = open(iptfile)
strprog = re.compile('"([^"]+)"')
lines = []
while 1:
line = fp.readline()
if not line: break
for line in fp:
if '{1, "' in line:
match = strprog.search(line)
if match:
......
......@@ -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
......
......@@ -50,10 +50,7 @@ class ColorDB:
self.__byname = {}
# all unique names (non-aliases). built-on demand
self.__allnames = None
while 1:
line = fp.readline()
if not line:
break
for line in fp:
# get this compiled regular expression from derived class
mo = self._re.match(line)
if not mo:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment