Skip to content
Snippets Groups Projects
Commit 4b7059f3 authored by Bruce Flynn's avatar Bruce Flynn
Browse files

trunc: catch stopiter

parent 93b7650e
No related branches found
No related tags found
No related merge requests found
...@@ -13,10 +13,16 @@ def trunc_stream(stream, start, end): ...@@ -13,10 +13,16 @@ def trunc_stream(stream, start, end):
# first pkt in group # first pkt in group
yield pkt yield pkt
# following pkts in group # following pkts in group
pkt = stream.next() try:
pkt = stream.next()
except StopIteration:
return
while pkt.stamp is None: while pkt.stamp is None:
yield pkt yield pkt
pkt = stream.next() try:
pkt = stream.next()
except StopIteration:
return
def trunc_file(filename, start, end, stream_impl=jpss_packet_stream): def trunc_file(filename, start, end, stream_impl=jpss_packet_stream):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment