mirror of https://github.com/Textualize/rich.git
remove finally
This commit is contained in:
parent
af0327d182
commit
dbeb776c90
|
@ -505,26 +505,31 @@ class Segment(NamedTuple):
|
||||||
pos = end_pos
|
pos = end_pos
|
||||||
break
|
break
|
||||||
|
|
||||||
try:
|
if end_pos == cut:
|
||||||
if end_pos == cut:
|
add_segment(segment)
|
||||||
add_segment(segment)
|
yield split_segments[:]
|
||||||
yield split_segments[:]
|
del split_segments[:]
|
||||||
del split_segments[:]
|
pos = end_pos
|
||||||
pos = end_pos
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
before, segment = segment.split_cells(cut - pos)
|
|
||||||
add_segment(before)
|
|
||||||
yield split_segments[:]
|
|
||||||
del split_segments[:]
|
|
||||||
pos = cut
|
|
||||||
finally:
|
|
||||||
try:
|
try:
|
||||||
cut = next(iter_cuts)
|
cut = next(iter_cuts)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
if split_segments:
|
if split_segments:
|
||||||
yield split_segments[:]
|
yield split_segments[:]
|
||||||
return
|
return
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
before, segment = segment.split_cells(cut - pos)
|
||||||
|
add_segment(before)
|
||||||
|
yield split_segments[:]
|
||||||
|
del split_segments[:]
|
||||||
|
pos = cut
|
||||||
|
|
||||||
|
try:
|
||||||
|
cut = next(iter_cuts)
|
||||||
|
except StopIteration:
|
||||||
|
if split_segments:
|
||||||
|
yield split_segments[:]
|
||||||
|
return
|
||||||
yield split_segments[:]
|
yield split_segments[:]
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue