logger: use next() to iterate over log lines (#36515)

This commit is contained in:
Frédéric Péters 2019-11-16 15:29:18 +01:00
parent 158d6fac2d
commit 228053c9ce
1 changed files with 3 additions and 3 deletions

View File

@ -98,16 +98,16 @@ def parse_logstream(stream):
non-blank character continue until the lines does not start with a blank non-blank character continue until the lines does not start with a blank
character character
''' '''
line = stream.next() line = next(stream)
while True: while True:
r = readline(line) r = readline(line)
try: try:
# Skip badly formatted lines # Skip badly formatted lines
if r is None: if r is None:
line = stream.next() line = next(stream)
continue continue
while True: while True:
line = stream.next() line = next(stream)
if line.startswith(' '): if line.startswith(' '):
# Append the line without the first blank # Append the line without the first blank
r['message'] = r['message'] + line[1:] r['message'] = r['message'] + line[1:]