Skip to content

Commit

Permalink
data.find_frames: fixed IndexError for no frames
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanmmacleod committed Mar 8, 2018
1 parent fdda71c commit 118a2aa
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions omicron/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ def find_frames(obs, frametype, start, end, connection=None, **kwargs):
# use latest frame to find more recent frames that aren't in
# datafind yet, this is quite hacky, and isn't guaranteed to
# work at any point, but it shouldn't break anything
latest = cache[-1]
try:
latest = cache[-1]
except IndexError: # no frames
return cache
try:
ngps = len(re_gwf_gps_epoch.search(
os.path.dirname(latest.path)).groupdict()['gpsepoch'])
except AttributeError:
except AttributeError: # no match
pass
else:
while True:
Expand Down

0 comments on commit 118a2aa

Please sign in to comment.