diff --git a/docs/source/usersguide/output/statepoint.rst b/docs/source/usersguide/output/statepoint.rst index d1ebc72312..d3c1729af6 100644 --- a/docs/source/usersguide/output/statepoint.rst +++ b/docs/source/usersguide/output/statepoint.rst @@ -4,7 +4,7 @@ State Point File Format ======================= -The current revision of the statepoint file format is 13. +The current revision of the statepoint file format is 14. **/filetype** (*char[]*) diff --git a/openmc/statepoint.py b/openmc/statepoint.py index 9e8177ba09..e64693746b 100644 --- a/openmc/statepoint.py +++ b/openmc/statepoint.py @@ -92,9 +92,14 @@ class StatePoint(object): self._f = h5py.File(filename, 'r') # Ensure filetype and revision are correct - if 'filetype' not in self._f or self._f[ - 'filetype'].value.decode() != 'statepoint': - raise IOError('{} is not a statepoint file.'.format(filename)) + try: + if 'filetype' not in self._f or self._f[ + 'filetype'].value.decode() != 'statepoint': + raise IOError('{} is not a statepoint file.'.format(filename)) + except AttributeError: + raise IOError('Could not read statepoint file. This most likely ' + 'means the statepoint file was produced by a different ' + 'version of OpenMC than the one you are using.') if self._f['revision'].value != 14: raise IOError('Statepoint file has a file revision of {} ' 'which is not consistent with the revision this '