Skip to content

Commit

Permalink
adding return values to hdf5_open() to facilitate handling a missing …
Browse files Browse the repository at this point in the history
…file
  • Loading branch information
umansky committed Jun 20, 2020
1 parent 7429e10 commit f4254af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyscripts/hdf5.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def hdf5_restore(file):
print(error)
except:
print("Couldn't open hdf5 file ", file)
return
return False

try:
dummy = hf['bbb'] # force an exception if the group not there
Expand Down Expand Up @@ -86,6 +86,7 @@ def hdf5_restore(file):
print("Couldn't read tgs from ", file)

hf.close()
return True


def hdf5_save(file, varlist=['bbb.ngs', 'bbb.ng',
Expand Down

0 comments on commit f4254af

Please sign in to comment.