Skip to content

Commit

Permalink
[FIX] Adds missing exception raise for correct handling `find_first_m…
Browse files Browse the repository at this point in the history
…atch` for case with `snap=0` in `sim/bifrost.py`.
  • Loading branch information
M1kol4j committed Jan 25, 2023
1 parent c4c3193 commit c6b46c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions helita/sim/bifrost.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,23 @@ def __init__(self, file_root, snap=None, meshfile=None, fdir='.',
self.set_snap(snap)
try:
tmp = find_first_match("%s*%d*.idl" % (file_root, snap), fdir)
if tmp == None:
raise IndexError
except IndexError:
try:
tmp = find_first_match("%s*idl" % file_root, fdir)
if tmp == None:
raise IndexError
except IndexError:
try:
tmp = find_first_match("%s*idl.scr" % file_root, fdir)
if tmp == None:
raise IndexError
except IndexError:
try:
tmp = find_first_match("mhd.in", fdir)
if tmp == None:
raise IndexError
except IndexError:
raise ValueError(("(EEE) init: no .idl or mhd.in files "
"found"))
Expand Down

0 comments on commit c6b46c6

Please sign in to comment.