Catch StopIteration exception for python 3.7 compatibility.

LT1AB
Bryan Riel 2019-02-07 10:30:20 -08:00
parent 64113c7030
commit 126e957fe6
1 changed files with 7 additions and 4 deletions

View File

@ -46,10 +46,13 @@ from .reserved import glyphs
def _unwrap_lines(gline, wrap=glyphs.WRAP):
"""given a read_stream() generator, yield UNWRAPPED RDF lines"""
while True:
try:
line = next(gline)
while line.endswith(wrap):
line = line[:-len(wrap)] + next(gline)
yield line
except StopIteration:
return
## file name --> unwrapped lines
# \param src A file name