Catch StopIteration exception for python 3.7 compatibility.
parent
64113c7030
commit
126e957fe6
|
@ -46,10 +46,13 @@ from .reserved import glyphs
|
||||||
def _unwrap_lines(gline, wrap=glyphs.WRAP):
|
def _unwrap_lines(gline, wrap=glyphs.WRAP):
|
||||||
"""given a read_stream() generator, yield UNWRAPPED RDF lines"""
|
"""given a read_stream() generator, yield UNWRAPPED RDF lines"""
|
||||||
while True:
|
while True:
|
||||||
line = next(gline)
|
try:
|
||||||
while line.endswith(wrap):
|
line = next(gline)
|
||||||
line = line[:-len(wrap)] + next(gline)
|
while line.endswith(wrap):
|
||||||
yield line
|
line = line[:-len(wrap)] + next(gline)
|
||||||
|
yield line
|
||||||
|
except StopIteration:
|
||||||
|
return
|
||||||
|
|
||||||
## file name --> unwrapped lines
|
## file name --> unwrapped lines
|
||||||
# \param src A file name
|
# \param src A file name
|
||||||
|
|
Loading…
Reference in New Issue